summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/WebView/WebPreferences.mm
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-11 17:01:47 +0100
committerBen Murdoch <benm@google.com>2009-08-11 18:21:02 +0100
commit0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch)
tree2943df35f62d885c89d01063cc528dd73b480fea /WebKit/mac/WebView/WebPreferences.mm
parent7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff)
downloadexternal_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2
Merge in WebKit r47029.
Diffstat (limited to 'WebKit/mac/WebView/WebPreferences.mm')
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm72
1 files changed, 48 insertions, 24 deletions
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index 6db14bd..378b280 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -345,13 +345,11 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:YES], WebKitAuthorAndUserStylesEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitApplicationChromeModeEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitWebArchiveDebugModeEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitLocalFileContentSniffingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitOfflineWebApplicationCacheEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitZoomsTextOnlyPreferenceKey,
-#ifndef NDEBUG
- // In Release and Production we skip a lot of object teardown during quit to speed up shutdown time. This breaks
- // our RefCount Leak tracking, and so for Debug we will use the full document teardown.
- [NSNumber numberWithBool:YES], WebKitEnableFullDocumentTeardownPreferenceKey,
-#endif
+ [NSNumber numberWithBool:YES], WebKitXSSAuditorEnabledPreferenceKey,
+ [NSNumber numberWithBool:YES], WebKitAcceleratedCompositingEnabledPreferenceKey,
nil];
// This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
@@ -795,6 +793,16 @@ static WebCacheModel cacheModelForMainBundle(void)
[self _setBoolValue:flag forKey:WebKitWebArchiveDebugModeEnabledPreferenceKey];
}
+- (BOOL)localFileContentSniffingEnabled
+{
+ return [self _boolValueForKey:WebKitLocalFileContentSniffingEnabledPreferenceKey];
+}
+
+- (void)setLocalFileContentSniffingEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitLocalFileContentSniffingEnabledPreferenceKey];
+}
+
- (BOOL)offlineWebApplicationCacheEnabled
{
return [self _boolValueForKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey];
@@ -815,6 +823,16 @@ static WebCacheModel cacheModelForMainBundle(void)
[self _setBoolValue:flag forKey:WebKitZoomsTextOnlyPreferenceKey];
}
+- (BOOL)isXSSAuditorEnabled
+{
+ return [self _boolValueForKey:WebKitXSSAuditorEnabledPreferenceKey];
+}
+
+- (void)setXSSAuditorEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitXSSAuditorEnabledPreferenceKey];
+}
+
- (BOOL)respectStandardStyleKeyEquivalents
{
return [self _boolValueForKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey];
@@ -1032,6 +1050,11 @@ static WebCacheModel cacheModelForMainBundle(void)
- (void)_postPreferencesChangesNotification
{
+ if (!pthread_main_np()) {
+ [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO];
+ return;
+ }
+
[[NSNotificationCenter defaultCenter]
postNotificationName:WebPreferencesChangedNotification object:self
userInfo:nil];
@@ -1046,10 +1069,11 @@ static WebCacheModel cacheModelForMainBundle(void)
{
NSString *systemEncodingName = (NSString *)CFStringConvertEncodingToIANACharSetName([self _systemCFStringEncoding]);
- // CFStringConvertEncodingToIANACharSetName() returns CP949 for kTextEncodingDOSKorean AKA "extended EUC-KR" AKA windows-939.
+ // CFStringConvertEncodingToIANACharSetName() returns cp949 for kTextEncodingDOSKorean AKA "extended EUC-KR" AKA windows-939.
// ICU uses this name for a different encoding, so we need to change the name to a value that actually gives us windows-939.
// In addition, this value must match what is used in Safari, see <rdar://problem/5579292>.
- if ([systemEncodingName isEqualToString:@"CP949"])
+ // On some OS versions, the result is CP949 (uppercase).
+ if ([systemEncodingName _webkit_isCaseInsensitiveEqualToString:@"cp949"])
systemEncodingName = @"ks_c_5601-1987";
[[NSUserDefaults standardUserDefaults] registerDefaults:
[NSDictionary dictionaryWithObject:systemEncodingName forKey:WebKitDefaultTextEncodingNamePreferenceKey]];
@@ -1074,11 +1098,6 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:DOMPasteAllowed forKey:WebKitDOMPasteAllowedPreferenceKey];
}
-- (void)_setFTPDirectoryTemplatePath:(NSString *)path
-{
- [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitFTPDirectoryTemplatePath];
-}
-
- (NSString *)_localStorageDatabasePath
{
return [[self _stringValueForKey:WebKitLocalStorageDatabasePathPreferenceKey] stringByStandardizingPath];
@@ -1094,9 +1113,9 @@ static NSString *classIBCreatorID = nil;
return [[self _stringValueForKey:WebKitFTPDirectoryTemplatePath] stringByStandardizingPath];
}
-- (void)_setForceFTPDirectoryListings:(BOOL)force
+- (void)_setFTPDirectoryTemplatePath:(NSString *)path
{
- [self _setBoolValue:force forKey:WebKitForceFTPDirectoryListings];
+ [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitFTPDirectoryTemplatePath];
}
- (BOOL)_forceFTPDirectoryListings
@@ -1104,6 +1123,21 @@ static NSString *classIBCreatorID = nil;
return [self _boolValueForKey:WebKitForceFTPDirectoryListings];
}
+- (void)_setForceFTPDirectoryListings:(BOOL)force
+{
+ [self _setBoolValue:force forKey:WebKitForceFTPDirectoryListings];
+}
+
+- (BOOL)acceleratedCompositingEnabled
+{
+ return [self _boolValueForKey:WebKitAcceleratedCompositingEnabledPreferenceKey];
+}
+
+- (void)setAcceleratedCompositingEnabled:(BOOL)enabled
+{
+ [self _setBoolValue:enabled forKey:WebKitAcceleratedCompositingEnabledPreferenceKey];
+}
+
- (void)didRemoveFromWebView
{
ASSERT(_private->numWebViews);
@@ -1118,16 +1152,6 @@ static NSString *classIBCreatorID = nil;
{
++_private->numWebViews;
}
-
-- (void)setFullDocumentTeardownEnabled:(BOOL)fullDocumentTeardownEnabled
-{
- [self _setBoolValue:fullDocumentTeardownEnabled forKey:WebKitEnableFullDocumentTeardownPreferenceKey];
-}
-
-- (BOOL)fullDocumentTeardownEnabled
-{
- return [self _boolValueForKey:WebKitEnableFullDocumentTeardownPreferenceKey];
-}
@end
@implementation WebPreferences (WebInternal)