[Chromium] ChromeClientImpl::dispatchViewportPropertiesDidChange is repeatedly called...
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 22:42:26 +0000 (22:42 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jan 2012 22:42:26 +0000 (22:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77429

Reviewed by Darin Fisher.

m_webView->isPageScaleFactorSet() is tested in ChromeClientImpl::layoutUpdated, and it is never true,
because WebViewImpl::setPageScaleFactorPreservingScrollOffset is called repeatedly and exits early
and thus never calls WebViewImpl::setPageScaleFactor which sets the flag.

The simplest solution is to simply get rid of the early return in
WebViewImpl::setPageScaleFactorPreservingScrollOffset.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setPageScaleFactorPreservingScrollOffset):

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

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebViewImpl.cpp

index 07ee5e8..51f1b3d 100644 (file)
@@ -1,5 +1,22 @@
 2012-01-31  Fady Samuel  <fsamuel@chromium.org>
 
+        [Chromium] ChromeClientImpl::dispatchViewportPropertiesDidChange is repeatedly called in Google News
+        https://bugs.webkit.org/show_bug.cgi?id=77429
+
+        Reviewed by Darin Fisher.
+
+        m_webView->isPageScaleFactorSet() is tested in ChromeClientImpl::layoutUpdated, and it is never true, 
+        because WebViewImpl::setPageScaleFactorPreservingScrollOffset is called repeatedly and exits early 
+        and thus never calls WebViewImpl::setPageScaleFactor which sets the flag.
+        
+        The simplest solution is to simply get rid of the early return in 
+        WebViewImpl::setPageScaleFactorPreservingScrollOffset.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::setPageScaleFactorPreservingScrollOffset):
+
+2012-01-31  Fady Samuel  <fsamuel@chromium.org>
+
         [Chromium] Expose setLayoutFallbackWidth as a WebSetting
         https://bugs.webkit.org/show_bug.cgi?id=77431
 
index d5a8ba8..e9fed27 100644 (file)
@@ -2030,8 +2030,6 @@ void WebViewImpl::setPageScaleFactorPreservingScrollOffset(float scaleFactor)
 {
     // Pick a scale factor that is within the expected limits
     scaleFactor = clampPageScaleFactorToLimits(scaleFactor);
-    if (scaleFactor == pageScaleFactor())
-        return;
 
     IntPoint scrollOffsetAtNewScale(mainFrame()->scrollOffset().width, mainFrame()->scrollOffset().height);
     float deltaScale = scaleFactor / pageScaleFactor();