Title: [127420] trunk/Source/WebKit2
Revision
127420
Author
[email protected]
Date
2012-09-03 07:15:03 -0700 (Mon, 03 Sep 2012)

Log Message

Wheel-events fails temporarily after reload
https://bugs.webkit.org/show_bug.cgi?id=94934

Reviewed by Kenneth Rohde Christiansen.

Set fixed visible content rect using visibleContentBounds instead of WebPage::size. Otherwise the
content rect will be incorrectly set to the entire document size, when resizesToContents is active.

Test: UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml

* UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (127419 => 127420)


--- trunk/Source/WebKit2/ChangeLog	2012-09-03 14:01:17 UTC (rev 127419)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-03 14:15:03 UTC (rev 127420)
@@ -1,3 +1,19 @@
+2012-09-03  Allan Sandfeld Jensen  <[email protected]>
+
+        Wheel-events fails temporarily after reload
+        https://bugs.webkit.org/show_bug.cgi?id=94934
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Set fixed visible content rect using visibleContentBounds instead of WebPage::size. Otherwise the 
+        content rect will be incorrectly set to the entire document size, when resizesToContents is active.
+
+        Test: UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml
+
+        * UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
+
 2012-09-03  Jinwoo Song  <[email protected]>
 
         [EFL] Use WebKitVersion.h to get version information

Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml (127419 => 127420)


--- trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml	2012-09-03 14:01:17 UTC (rev 127419)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_wheelEventHandling.qml	2012-09-03 14:15:03 UTC (rev 127420)
@@ -42,5 +42,16 @@
             // The check below will fail if the previous position was not restored after reload.
             verify(position == webView.contentY)
         }
+
+        function test_wheelScrollEventAfterReload() {
+            scrollSpy.clear()
+            webView.reload()
+            verify(webView.waitForLoadSucceeded())
+            var centerPoint = Qt.point(webView.width / 2, webView.height / 2)
+            test.wheelEvent(webView, centerPoint.x, centerPoint.y, -500);
+            // The signal spy below will time out if the wheel event did not scroll the content.
+            scrollSpy.wait()
+        }
     }
+
 }

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (127419 => 127420)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2012-09-03 14:01:17 UTC (rev 127419)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2012-09-03 14:15:03 UTC (rev 127420)
@@ -1228,6 +1228,7 @@
     Color backgroundColor = webPage->drawsTransparentBackground() ? Color::transparent : Color::white;
     bool isMainFrame = webPage->mainWebFrame() == m_frame;
     bool shouldUseFixedLayout = isMainFrame && webPage->useFixedLayout();
+    IntRect currentVisibleContentBounds = m_frame->visibleContentBounds();
 
     const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
     m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForResponse(response);
@@ -1235,8 +1236,8 @@
 
     m_frame->coreFrame()->createView(webPage->size(), backgroundColor, /* transparent */ false, IntSize(), shouldUseFixedLayout);
     m_frame->coreFrame()->view()->setTransparent(!webPage->drawsBackground());
-    if (shouldUseFixedLayout)
-        m_frame->coreFrame()->view()->setFixedVisibleContentRect(webPage->bounds());
+    if (shouldUseFixedLayout && !currentVisibleContentBounds.isEmpty())
+        m_frame->coreFrame()->view()->setFixedVisibleContentRect(currentVisibleContentBounds);
 }
 
 void WebFrameLoaderClient::didSaveToPageCache()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to