Title: [105528] trunk/Source/WebKit/chromium
Revision
105528
Author
[email protected]
Date
2012-01-20 11:08:33 -0800 (Fri, 20 Jan 2012)

Log Message

[Chromium] Do not recompute viewport on same page navigation
https://bugs.webkit.org/show_bug.cgi?id=75576

Reviewed by Darin Fisher.

Added parameter isNavigationWithinPage to WebViewImpl::didCommitLoad
that indicates whether a same-page navigation has just occurred.

The page scale factor flag is reset only on navigation to a new page.
If the flag is not set, viewport and page scale will be recomputed on
layoutUpdated.

* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::dispatchDidNavigateWithinPage):
(WebKit::FrameLoaderClientImpl::dispatchDidCommitLoad):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::didCommitLoad):
(WebKit::WebViewImpl::observeNewNavigation):
* src/WebViewImpl.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (105527 => 105528)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-01-20 19:06:27 UTC (rev 105527)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-01-20 19:08:33 UTC (rev 105528)
@@ -1,3 +1,25 @@
+2012-01-20  Fady Samuel  <[email protected]>
+
+        [Chromium] Do not recompute viewport on same page navigation
+        https://bugs.webkit.org/show_bug.cgi?id=75576
+
+        Reviewed by Darin Fisher.
+
+        Added parameter isNavigationWithinPage to WebViewImpl::didCommitLoad
+        that indicates whether a same-page navigation has just occurred.
+
+        The page scale factor flag is reset only on navigation to a new page.
+        If the flag is not set, viewport and page scale will be recomputed on
+        layoutUpdated.
+
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::dispatchDidNavigateWithinPage):
+        (WebKit::FrameLoaderClientImpl::dispatchDidCommitLoad):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::didCommitLoad):
+        (WebKit::WebViewImpl::observeNewNavigation):
+        * src/WebViewImpl.h:
+
 2012-01-20  Pavel Feldman  <[email protected]>
 
         Web Inspector: [chromium] add WebDevToolsFrontendClient::openInNewTab for upcoming WebCore change.

Modified: trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp (105527 => 105528)


--- trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp	2012-01-20 19:06:27 UTC (rev 105527)
+++ trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp	2012-01-20 19:08:33 UTC (rev 105528)
@@ -693,7 +693,7 @@
     }
 
     bool isNewNavigation;
-    webView->didCommitLoad(&isNewNavigation);
+    webView->didCommitLoad(&isNewNavigation, true);
     if (m_webFrame->client())
         m_webFrame->client()->didNavigateWithinPage(m_webFrame, isNewNavigation);
 
@@ -805,7 +805,7 @@
 {
     WebViewImpl* webview = m_webFrame->viewImpl();
     bool isNewNavigation;
-    webview->didCommitLoad(&isNewNavigation);
+    webview->didCommitLoad(&isNewNavigation, false);
 
     if (m_webFrame->client())
         m_webFrame->client()->didCommitProvisionalLoad(m_webFrame, isNewNavigation);

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (105527 => 105528)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-01-20 19:06:27 UTC (rev 105527)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-01-20 19:08:33 UTC (rev 105528)
@@ -2649,7 +2649,7 @@
     pageGroup->removeAllUserContent();
 }
 
-void WebViewImpl::didCommitLoad(bool* isNewNavigation)
+void WebViewImpl::didCommitLoad(bool* isNewNavigation, bool isNavigationWithinPage)
 {
     if (isNewNavigation)
         *isNewNavigation = m_observedNewNavigation;
@@ -2660,6 +2660,8 @@
     m_newNavigationLoader = 0;
 #endif
     m_observedNewNavigation = false;
+    if (!isNavigationWithinPage)
+        m_pageScaleFactorIsSet = false;
 }
 
 void WebViewImpl::layoutUpdated(WebFrameImpl* webframe)
@@ -2742,9 +2744,6 @@
 void WebViewImpl::observeNewNavigation()
 {
     m_observedNewNavigation = true;
-    // FIXME: We need to make sure that m_pageScaleFactorIsSet is not reset
-    // on same page navigations.
-    m_pageScaleFactorIsSet = false;
 #ifndef NDEBUG
     m_newNavigationLoader = m_page->mainFrame()->loader()->documentLoader();
 #endif

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (105527 => 105528)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2012-01-20 19:06:27 UTC (rev 105527)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2012-01-20 19:08:33 UTC (rev 105528)
@@ -331,8 +331,9 @@
 
     // Notifies the WebView that a load has been committed. isNewNavigation
     // will be true if a new session history item should be created for that
-    // load.
-    void didCommitLoad(bool* isNewNavigation);
+    // load. isNavigationWithinPage will be true if the navigation does
+    // not take the user away from the current page.
+    void didCommitLoad(bool* isNewNavigation, bool isNavigationWithinPage);
 
     // Indicates two things:
     //   1) This view may have a new layout now.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to