Title: [204554] trunk
Revision
204554
Author
[email protected]
Date
2016-08-16 22:48:27 -0700 (Tue, 16 Aug 2016)

Log Message

[iOS WK2] Don't throw touchMove events on the floor
https://bugs.webkit.org/show_bug.cgi?id=160935

Reviewed by Tim Horton.

Source/WebKit2:

EventDispatcher claimed to coalesce touchMove events, but actually threw away any
touchMove if there was one in the queue when the next non-move event came along.

Fix to strictly coalesce touchMove events, so a start/move/end stream always fires
a move event. This is necessary for move-based interaction to work in testing,
for example the added range slider test.

Test: fast/forms/ios/drag-range-thumb.html

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::touchEvent):

LayoutTests:

Test for range slider interaction with synthesized touch events.

* fast/forms/ios/drag-range-thumb-expected.txt: Added.
* fast/forms/ios/drag-range-thumb.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (204553 => 204554)


--- trunk/LayoutTests/ChangeLog	2016-08-17 04:42:53 UTC (rev 204553)
+++ trunk/LayoutTests/ChangeLog	2016-08-17 05:48:27 UTC (rev 204554)
@@ -1,3 +1,15 @@
+2016-08-16  Simon Fraser  <[email protected]>
+
+        [iOS WK2] Don't throw touchMove events on the floor
+        https://bugs.webkit.org/show_bug.cgi?id=160935
+
+        Reviewed by Tim Horton.
+        
+        Test for range slider interaction with synthesized touch events.
+
+        * fast/forms/ios/drag-range-thumb-expected.txt: Added.
+        * fast/forms/ios/drag-range-thumb.html: Added.
+
 2016-08-16  Ryosuke Niwa  <[email protected]>
 
         customElements.define should retrieve lifecycle callbacks

Added: trunk/LayoutTests/fast/forms/ios/drag-range-thumb-expected.txt (0 => 204554)


--- trunk/LayoutTests/fast/forms/ios/drag-range-thumb-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/ios/drag-range-thumb-expected.txt	2016-08-17 05:48:27 UTC (rev 204554)
@@ -0,0 +1,4 @@
+Tests that a basic range slider works
+
+
+Successfully handled oninput, value is now "456"

Added: trunk/LayoutTests/fast/forms/ios/drag-range-thumb.html (0 => 204554)


--- trunk/LayoutTests/fast/forms/ios/drag-range-thumb.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/ios/drag-range-thumb.html	2016-08-17 05:48:27 UTC (rev 204554)
@@ -0,0 +1,71 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<head>
+    <meta name="viewport" content="width=device-width">
+    <style>
+        input[type="range"] {
+            width: 300px;
+        }
+    </style>
+    
+    <script src=""
+    <script>
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+        testRunner.waitUntilDone();
+    }
+
+    var uiScriptHasCompleted = false;
+    var _oninputHasBeenHandled_ = false;
+
+    function getUIScript(startX, startY, endX, endY, duration)
+    {
+        return `
+            (function() {
+                uiController.dragFromPointToPoint(${startX}, ${startY}, ${endX}, ${endY}, ${duration}, function() {
+                    uiController.uiScriptComplete();
+                });
+            })();`
+    }
+
+    function checkDone()
+    {
+        if (oninputHasBeenHandled && uiScriptHasCompleted)
+            testRunner.notifyDone();
+    }
+
+    function handleValueChanged(value)
+    {
+        document.getElementById("console").textContent = "Successfully handled oninput, value is now \"" + value.toLowerCase() + "\"";
+        _oninputHasBeenHandled_ = true;
+        checkDone();
+    }
+    
+    function doTest()
+    {
+        if (!window.testRunner || !testRunner.runUIScript)
+            return;
+
+        var targetElement = document.getElementsByTagName('input')[0];
+        var point = getPointInsideElement(targetElement, 10, 10);
+
+        testRunner.runUIScript(getUIScript(point.x, point.y, point.x + 200, point.y, 0.05), function() {
+            uiScriptHasCompleted = true;
+            checkDone();
+        });
+    }
+
+    window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+
+<p>Tests that a basic range slider works</p>
+
+<input type="range" min="100" max="600" value="100" _oninput_="handleValueChanged(this.value)">
+
+<div id="console">Failed to handle oninput<div>
+
+</body>
+</html>

Modified: trunk/Source/WebKit2/ChangeLog (204553 => 204554)


--- trunk/Source/WebKit2/ChangeLog	2016-08-17 04:42:53 UTC (rev 204553)
+++ trunk/Source/WebKit2/ChangeLog	2016-08-17 05:48:27 UTC (rev 204554)
@@ -1,5 +1,24 @@
 2016-08-16  Simon Fraser  <[email protected]>
 
+        [iOS WK2] Don't throw touchMove events on the floor
+        https://bugs.webkit.org/show_bug.cgi?id=160935
+
+        Reviewed by Tim Horton.
+        
+        EventDispatcher claimed to coalesce touchMove events, but actually threw away any
+        touchMove if there was one in the queue when the next non-move event came along.
+        
+        Fix to strictly coalesce touchMove events, so a start/move/end stream always fires
+        a move event. This is necessary for move-based interaction to work in testing,
+        for example the added range slider test.
+        
+        Test: fast/forms/ios/drag-range-thumb.html
+
+        * WebProcess/WebPage/EventDispatcher.cpp:
+        (WebKit::EventDispatcher::touchEvent):
+
+2016-08-16  Simon Fraser  <[email protected]>
+
         [iOS WK2] Clean up form select code
         https://bugs.webkit.org/show_bug.cgi?id=160915
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp (204553 => 204554)


--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp	2016-08-17 04:42:53 UTC (rev 204553)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp	2016-08-17 05:48:27 UTC (rev 204554)
@@ -180,8 +180,7 @@
             const WebTouchEvent& lastTouchEvent = queuedEvents.last();
 
             // Coalesce touch move events.
-            WebEvent::Type type = lastTouchEvent.type();
-            if (type == WebEvent::TouchMove)
+            if (touchEvent.type() == WebEvent::TouchMove && lastTouchEvent.type() == WebEvent::TouchMove)
                 queuedEvents.last() = touchEvent;
             else
                 queuedEvents.append(touchEvent);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to