Reviewed by Tim
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2007 22:10:08 +0000 (22:10 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2007 22:10:08 +0000 (22:10 +0000)
        - fixed <rdar://problem/5092556> Default UA spoofing is always off until explicitly toggled

        * WebView/WebView.mm:
        (-[WebView _commonInitializationWithFrameName:groupName:]):
        initialize the cached value of _private->useSiteSpecificSpoofing here; formerly it would not
        be initialized correctly in the common case of WebViews that use [WebPreferences standardPreferences]

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20537 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/WebView/WebView.mm

index 5b9c574..3a68c64 100644 (file)
@@ -1,3 +1,14 @@
+2007-03-27  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Tim
+        
+        - fixed <rdar://problem/5092556> Default UA spoofing is always off until explicitly toggled
+
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+        initialize the cached value of _private->useSiteSpecificSpoofing here; formerly it would not
+        be initialized correctly in the common case of WebViews that use [WebPreferences standardPreferences]
+
 2007-03-27  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Dave Harrison.
index cbb8536..8875104 100644 (file)
@@ -1619,7 +1619,7 @@ NSMutableDictionary *countInvocations;
     _private->drawsBackground = YES;
     _private->smartInsertDeleteEnabled = YES;
     _private->backgroundColor = [[NSColor whiteColor] retain];
-
+    
     NSRect f = [self frame];
     WebFrameView *frameView = [[WebFrameView alloc] initWithFrame: NSMakeRect(0,0,f.size.width,f.size.height)];
     [frameView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
@@ -1655,14 +1655,20 @@ NSMutableDictionary *countInvocations;
     if ([WebView _scriptDebuggerEnabled])
         [WebScriptDebugServer sharedScriptDebugServer];
 
+    WebPreferences *prefs = [self preferences];
+    
     // Update WebCore with preferences.  These values will either come from an archived WebPreferences,
     // or from the standard preferences, depending on whether this method was called from initWithCoder:
     // or initWithFrame, respectively.
-    [self _updateWebCoreSettingsFromPreferences: [self preferences]];
+    [self _updateWebCoreSettingsFromPreferences:prefs];
+
+    // Initialize this cached value for the common case where we're using [WebPreferences standardPreferences],
+    // since neither setPreferences: nor _preferencesChangedNotification: will be called.
+    _private->useSiteSpecificSpoofing = [prefs _useSiteSpecificSpoofing];
     
     // Register to receive notifications whenever preference values change.
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:)
-                                                 name:WebPreferencesChangedNotification object:[self preferences]];
+                                                 name:WebPreferencesChangedNotification object:prefs];
 
     if (WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION))
         FrameLoader::setRestrictAccessToLocal(true);