2011-01-25 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Jan 2011 17:54:27 +0000 (17:54 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Jan 2011 17:54:27 +0000 (17:54 +0000)
        Reviewed by Anders Carlsson.

        Improve scale factor resetting
        https://bugs.webkit.org/show_bug.cgi?id=53093

        Two key changes:
        - Don't set the scale factor to what it already is, as this causes an
        uneeded force layout and scroll
        - Don't ever set the scale factor based on a non-main frame committing

        This fixes two WebKit2 layout tests.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

index 7f87de7..86da191 100644 (file)
@@ -1,3 +1,20 @@
+2011-01-25  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Improve scale factor resetting
+        https://bugs.webkit.org/show_bug.cgi?id=53093
+        
+        Two key changes:
+        - Don't set the scale factor to what it already is, as this causes an
+        uneeded force layout and scroll
+        - Don't ever set the scale factor based on a non-main frame committing
+        
+        This fixes two WebKit2 layout tests.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
+
 2011-01-24  Chris Marrin  <cmarrin@apple.com>
 
         Reviewed by Eric Seidel.
index ecfede0..dc59397 100644 (file)
@@ -430,14 +430,11 @@ void WebFrameLoaderClient::dispatchDidCommitLoad()
 
     webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), response.mimeType(), m_frameHasCustomRepresentation, PlatformCertificateInfo(response), InjectedBundleUserMessageEncoder(userData.get())));
 
-    // Restore the page scale factor.
-    double newPageScaleFactor = m_frame->coreFrame()->pageScaleFactor();
-    
     // Only restore the scale factor for standard frame loads (of the main frame).
-    if (m_frame->isMainFrame() && m_frame->coreFrame()->loader()->loadType() == FrameLoadTypeStandard)
-        newPageScaleFactor = 1.0;
-
-    webPage->scaleWebView(newPageScaleFactor, IntPoint());
+    if (m_frame->isMainFrame() && m_frame->coreFrame()->loader()->loadType() == FrameLoadTypeStandard) {
+        if (m_frame->coreFrame()->pageScaleFactor() != 1.0)
+            webPage->scaleWebView(1.0, IntPoint());
+    }
 }
 
 void WebFrameLoaderClient::dispatchDidFailProvisionalLoad(const ResourceError& error)