Title: [245584] trunk/LayoutTests/imported/w3c
Revision
245584
Author
grao...@webkit.org
Date
2019-05-21 10:49:28 -0700 (Tue, 21 May 2019)

Log Message

[Pointer Events] Do not dispatch pointermove events when the pointer is not down in WPT testdriver
https://bugs.webkit.org/show_bug.cgi?id=198071

Reviewed by Dean Jackson.

WPT actions sequences may move the pointer prior to pressing it down. In this case, we need to make sure we don't
end up queuing a "moved" touch and instead save the pointer position for when the pointer is pressed. It's important
to also generate a different touch id for each time we pause or end a touch sequence. This allows a few more WPT
touch tests to pass without any source change in our Pointer Events implementation.

* web-platform-tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch-expected.txt:
* web-platform-tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch-expected.txt:
* web-platform-tests/pointerevents/pointerevent_touch-action-auto-css_touch-expected.txt:
* web-platform-tests/pointerevents/pointerevent_touch-action-inherit_highest-parent-none_touch-expected.txt:
* web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch-expected.txt:
* web-platform-tests/resources/testdriver-vendor.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (245583 => 245584)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-05-21 17:30:41 UTC (rev 245583)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-05-21 17:49:28 UTC (rev 245584)
@@ -1,3 +1,22 @@
+2019-05-21  Antoine Quint  <grao...@apple.com>
+
+        [Pointer Events] Do not dispatch pointermove events when the pointer is not down in WPT testdriver
+        https://bugs.webkit.org/show_bug.cgi?id=198071
+
+        Reviewed by Dean Jackson.
+
+        WPT actions sequences may move the pointer prior to pressing it down. In this case, we need to make sure we don't
+        end up queuing a "moved" touch and instead save the pointer position for when the pointer is pressed. It's important
+        to also generate a different touch id for each time we pause or end a touch sequence. This allows a few more WPT
+        touch tests to pass without any source change in our Pointer Events implementation.
+
+        * web-platform-tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch-expected.txt:
+        * web-platform-tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch-expected.txt:
+        * web-platform-tests/pointerevents/pointerevent_touch-action-auto-css_touch-expected.txt:
+        * web-platform-tests/pointerevents/pointerevent_touch-action-inherit_highest-parent-none_touch-expected.txt:
+        * web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch-expected.txt:
+        * web-platform-tests/resources/testdriver-vendor.js:
+
 2019-05-17  Rob Buis  <rb...@igalia.com>
 
         Implement imagesrcset and imagesizes attributes on link rel=preload

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch-expected.txt (245583 => 245584)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch-expected.txt	2019-05-21 17:30:41 UTC (rev 245583)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch-expected.txt	2019-05-21 17:49:28 UTC (rev 245584)
@@ -6,7 +6,7 @@
 
 Pointer Events pointerleave tests
 
-The following pointer types were detected: (none).
+The following pointer types were detected: touch.
 
 
 FAIL pointerleave event received assert_true: pointerleave should be received before the test finishes expected true got false

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch-expected.txt (245583 => 245584)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch-expected.txt	2019-05-21 17:30:41 UTC (rev 245583)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch-expected.txt	2019-05-21 17:49:28 UTC (rev 245584)
@@ -6,7 +6,7 @@
 
 Pointer Events pointerout tests
 
-The following pointer types were detected: (none).
+The following pointer types were detected: touch.
 
 
 FAIL pointerout event received assert_true: pointerout should be received before the test finishes expected true got false

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-auto-css_touch-expected.txt (245583 => 245584)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-auto-css_touch-expected.txt	2019-05-21 17:30:41 UTC (rev 245583)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-auto-css_touch-expected.txt	2019-05-21 17:49:28 UTC (rev 245584)
@@ -1,6 +1,6 @@
 Pointer Events touch-action attribute support
 
-Test Description: Try to scroll text RIGHT.
+Test Description: Test complete
 
 Note: this test is for touch-devices only
 
@@ -73,5 +73,5 @@
 The following pointer types were detected: touch.
 
 
-FAIL touch-action attribute test assert_true: x-scroll and y-scroll should be received before the test finishes expected true got false
+PASS touch-action attribute test 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-inherit_highest-parent-none_touch-expected.txt (245583 => 245584)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-inherit_highest-parent-none_touch-expected.txt	2019-05-21 17:30:41 UTC (rev 245583)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-inherit_highest-parent-none_touch-expected.txt	2019-05-21 17:49:28 UTC (rev 245584)
@@ -1,6 +1,6 @@
 Pointer Events touch-action attribute support
 
-Test Description: Try to scroll text RIGHT.
+Test Description: Test complete
 
 Note: this test is for touch-devices only
 
@@ -73,5 +73,5 @@
 The following pointer types were detected: touch.
 
 
-FAIL touch-action attribute test assert_true: x-scroll and y-scroll should be received before the test finishes expected true got false
+PASS touch-action attribute test 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch-expected.txt (245583 => 245584)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch-expected.txt	2019-05-21 17:30:41 UTC (rev 245583)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch-expected.txt	2019-05-21 17:49:28 UTC (rev 245584)
@@ -1,6 +1,6 @@
 Pointer Events touch-action attribute support
 
-Test Description: Try to scroll text RIGHT.
+Test Description: Test complete
 
 Note: this test is for touch-devices only
 
@@ -73,5 +73,5 @@
 The following pointer types were detected: touch.
 
 
-FAIL touch-action attribute test assert_true: x-scroll and y-scroll should be received before the test finishes expected true got false
+PASS touch-action attribute test 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js (245583 => 245584)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js	2019-05-21 17:30:41 UTC (rev 245583)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js	2019-05-21 17:49:28 UTC (rev 245584)
@@ -54,11 +54,14 @@
     let x = 0;
     let y = 0;
     let timeOffset = 0;
+    let pointerDown = false;
+    let id = 1;
 
-    const events = actions.map(action ="" {
+    const events = [];
+    for (let action of actions) {
         const touch = {
             inputType : "finger",
-            id : 1,
+            id,
             x : action.x,
             y : action.y,
             pressure : 0
@@ -83,16 +86,25 @@
             }
             break;
         case "pointerDown":
+            pointerDown = true;
             touch.phase = "began";
+            if (action.x === undefined)
+                touch.x = x;
+            if (action.y === undefined)
+                touch.y = y;
             break;
         case "pointerUp":
+            pointerDown = false;
             touch.phase = "ended";
             touch.x = x;
             touch.y = y;
+            id++;
             break;
         case "pause":
             timeOffsetIncrease = action.duration / 1000;
             touch.phase = "stationary";
+            if (!pointerDown)
+                id++;
             break;
         default:
             return Promise.reject(new Error(`Unknown action type "${action.type}".`));
@@ -100,10 +112,14 @@
 
         x = touch.x;
         y = touch.y;
+
+        if (!pointerDown && touch.phase == "moved")
+            continue;
+
         timeOffset += timeOffsetIncrease;
 
-        return command;
-    });
+        events.push(command);
+    }
 
     const stream = JSON.stringify({ events });
     logDebug(() => stream);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to