Legacy WebKit should set deviceScaleFactor in _commonInitializationWithFrameName...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Dec 2014 19:28:43 +0000 (19:28 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Dec 2014 19:28:43 +0000 (19:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139306
<rdar://problem/19157955>

Reviewed by Beth Dakin.

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _initWithFrame:frameName:groupName:]):
Move setDeviceScaleFactor to the initialization path that is guaranteed to happen.

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm

index f4bb9a8..06bd887 100644 (file)
@@ -1,3 +1,16 @@
+2014-12-05  Tim Horton  <timothy_horton@apple.com>
+
+        Legacy WebKit should set deviceScaleFactor in _commonInitializationWithFrameName, not _initWithFrame
+        https://bugs.webkit.org/show_bug.cgi?id=139306
+        <rdar://problem/19157955>
+
+        Reviewed by Beth Dakin.
+
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+        (-[WebView _initWithFrame:frameName:groupName:]):
+        Move setDeviceScaleFactor to the initialization path that is guaranteed to happen.
+
 2014-12-05  David Kilzer  <ddkilzer@apple.com>
 
         FeatureDefines.xcconfig: Workaround bug in Xcode 5.1.1 when defining ENABLE_WEB_REPLAY
index 010bdab..b16db55 100644 (file)
@@ -1058,9 +1058,11 @@ static void WebKitInitializeGamepadProviderIfNecessary()
         SecurityPolicy::setLocalLoadPolicy(SecurityPolicy::AllowLocalLoadsForLocalAndSubstituteData);
     }
 
-#if !PLATFORM(IOS)
+#if PLATFORM(MAC)
     if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS))
         ResourceHandle::forceContentSniffing();
+
+    _private->page->setDeviceScaleFactor([self _deviceScaleFactor]);
 #endif
 
 #if USE(GLIB)
@@ -1089,9 +1091,6 @@ static void WebKitInitializeGamepadProviderIfNecessary()
     _private = [[WebViewPrivate alloc] init];
     [self _commonInitializationWithFrameName:frameName groupName:groupName];
     [self setMaintainsBackForwardList: YES];
-#if !PLATFORM(IOS)
-    _private->page->setDeviceScaleFactor([self _deviceScaleFactor]);
-#endif
     return self;
 }