Title: [167648] trunk
Revision
167648
Author
[email protected]
Date
2014-04-21 20:59:06 -0700 (Mon, 21 Apr 2014)

Log Message

[Mac] After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
https://bugs.webkit.org/show_bug.cgi?id=131960
<rdar://problem/16142100>

Reviewed by Darin Adler.


Source/WebCore: 
Test: platform/mac/fast/scrolling/scroll-div-no-latching.html

* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent): When not latching, always clear m_latchedWheelEventElement and m_previousWheelScrolledElement.

LayoutTests: 
* platform/mac/fast/scrolling/scroll-div-no-latching-expected.txt: Added.
* platform/mac/fast/scrolling/scroll-div-no-latching.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (167647 => 167648)


--- trunk/LayoutTests/ChangeLog	2014-04-22 03:26:22 UTC (rev 167647)
+++ trunk/LayoutTests/ChangeLog	2014-04-22 03:59:06 UTC (rev 167648)
@@ -1,3 +1,14 @@
+2014-04-21  Brent Fulgham  <[email protected]>
+
+        [Mac] After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
+        https://bugs.webkit.org/show_bug.cgi?id=131960
+        <rdar://problem/16142100>
+
+        Reviewed by Darin Adler.
+
+        * platform/mac/fast/scrolling/scroll-div-no-latching-expected.txt: Added.
+        * platform/mac/fast/scrolling/scroll-div-no-latching.html: Added.
+
 2014-04-21  Zalan Bujtas  <[email protected]>
 
         REGRESSION (r166784): Gradient at background of iCloud login page doesn’t go all the way to the bottom

Added: trunk/LayoutTests/platform/mac/fast/scrolling/scroll-div-no-latching-expected.txt (0 => 167648)


--- trunk/LayoutTests/platform/mac/fast/scrolling/scroll-div-no-latching-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/scrolling/scroll-div-no-latching-expected.txt	2014-04-22 03:59:06 UTC (rev 167648)
@@ -0,0 +1,11 @@
+Test region.
+Tests that scroll events of type 'none' work properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS Page received wheel events.
+

Added: trunk/LayoutTests/platform/mac/fast/scrolling/scroll-div-no-latching.html (0 => 167648)


--- trunk/LayoutTests/platform/mac/fast/scrolling/scroll-div-no-latching.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/scrolling/scroll-div-no-latching.html	2014-04-22 03:59:06 UTC (rev 167648)
@@ -0,0 +1,115 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+body {
+    height: 1200px;
+}
+
+.post {
+    width: 500px;
+    height: 600px;
+    overflow: auto;
+    border: 1px solid black;
+}
+
+.content {
+    width: 1000px;
+    height: 100%;
+    background-image: repeating-linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2) 100px), repeating-linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2) 100px);
+    
+}
+</style>
+<script src=""
+<script>
+function onLoad() {
+    setupTopLevel();
+}
+</script>
+</head>
+<body _onload_="onLoad();">
+<script>
+
+var divTarget;
+var pageScrollPositionBefore;
+var divScrollPositionBefore;
+var continueCount = 5;
+
+function checkForScroll() {
+    var pageScrollPositionAfter = document.body.scrollTop;
+    var divScrollPositionAfter = divTarget.scrollLeft;
+
+    //debug("Page before: " + pageScrollPositionBefore + ", div before: " + divScrollPositionBefore);
+    //debug("Page after:  " + pageScrollPositionAfter + ", div after: " + divScrollPositionAfter);
+
+    if (pageScrollPositionBefore != pageScrollPositionAfter)
+        testPassed("Page received wheel events.");
+    else
+        testFailed("Page did not receive wheel events.");
+
+    testRunner.notifyDone();
+}
+
+function scrollTest() {
+    // See where our IFrame lives:
+    pageScrollPositionBefore = document.body.scrollTop;
+
+    divTarget = document.getElementById('parent');
+
+    divScrollPositionBefore = divTarget.scrollLeft;
+
+    var startPosX = divTarget.offsetLeft + 20;
+    //debug("div display height = " + divTarget.clientHeight);
+    var startPosY = divTarget.offsetTop + (divTarget.clientHeight / 2); // One wheel turn before end.
+    eventSender.mouseMoveTo(startPosX, startPosY); // Make sure we are just outside the iFrame
+    //debug("Mouse moved to (" + startPosX + ", " + startPosY + ")");
+
+    //debug("Page before: " + pageScrollPositionBefore + ", div before: " + divScrollPositionBefore);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none', true);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 1, 'none', 'none', true);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none', true);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 1, 'none', 'none', true);
+
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none', true);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none', true);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none', true);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(-1, 0, 'none', 'none', true);
+
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none', true);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none', true);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'none', true);
+
+    setTimeout(checkForScroll, 100);
+}
+
+function setupTopLevel() {
+
+    if (window.eventSender) {
+        testRunner.waitUntilDone();
+
+        setTimeout(scrollTest, 1000);
+    } else {
+        var messageLocation = document.getElementById('parent');
+        var message = document.createElement('div');
+        message.innerHTML = "<p>This test is better run under DumpRenderTree. To manually test it, place the mouse pointer<br/>"
+            + "inside the textured region. (1) Use the mouse wheel to scroll vertically, then (2) hold the shift key while<br/>"
+            + "moving the mouse wheel to scroll horizontally, then (3) release the shift key and attempt to scroll vertically.<br/><br/>"
+            + "The final set of vertical moves should modify the parent page scroll position.</p>";
+        messageLocation.appendChild(message);
+    }
+}
+
+</script>
+    <div id="parent" class="post">
+        <div id="target" class="content">
+            Test region.
+        </div>
+    </div>
+</div>
+<div id="console"></div>
+<script>
+description("Tests that scroll events of type 'none' work properly.");
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (167647 => 167648)


--- trunk/Source/WebCore/ChangeLog	2014-04-22 03:26:22 UTC (rev 167647)
+++ trunk/Source/WebCore/ChangeLog	2014-04-22 03:59:06 UTC (rev 167648)
@@ -1,3 +1,16 @@
+2014-04-21  Brent Fulgham  <[email protected]>
+
+        [Mac] After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
+        https://bugs.webkit.org/show_bug.cgi?id=131960
+        <rdar://problem/16142100>
+
+        Reviewed by Darin Adler.
+
+        Test: platform/mac/fast/scrolling/scroll-div-no-latching.html
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleWheelEvent): When not latching, always clear m_latchedWheelEventElement and m_previousWheelScrolledElement.
+
 2014-04-21  Joseph Pecoraro  <[email protected]>
 
         WebProfilerAgent::disable is calling the wrong superclass method

Modified: trunk/Source/WebCore/page/EventHandler.cpp (167647 => 167648)


--- trunk/Source/WebCore/page/EventHandler.cpp	2014-04-22 03:26:22 UTC (rev 167647)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2014-04-22 03:59:06 UTC (rev 167648)
@@ -2576,6 +2576,11 @@
     ScrollableArea* scrollableArea = nullptr;
     platformPrepareForWheelEvents(e, result, element, scrollableContainer, scrollableArea, isOverWidget);
 
+    if (!e.useLatchedEventElement()) {
+        m_latchedWheelEventElement = nullptr;
+        m_previousWheelScrolledElement = nullptr;
+    }
+
     // FIXME: It should not be necessary to do this mutation here.
     // Instead, the handlers should know convert vertical scrolls
     // appropriately.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to