Title: [261246] trunk
Revision
261246
Author
[email protected]
Date
2020-05-06 12:57:34 -0700 (Wed, 06 May 2020)

Log Message

pointermove event sometimes has incorrect pointerType of 'mouse' on touch interactions
https://bugs.webkit.org/show_bug.cgi?id=210716
<rdar://problem/62084817>

Patch by Antoine Quint <[email protected]> on 2020-05-06
Reviewed by Darin Adler.

Source/WebKit:

Set the SyntheticClickType to OneFingerTap when creating a synthetic "mousemove" event for a synthetic "click" event as part of a tap.
On top of being more indicative of the actual action that triggered the synthetic event, it also has the added quality that it will
not yield a "pointermove" event.

Test: pointerevents/ios/click-no-pointermove.html

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::dispatchSyntheticMouseMove):

LayoutTests:

Add a new test that checks that with content observation enabled a tap on a <button> element
dispatches synthetic mousemove and click events but no pointermove event.

* pointerevents/ios/click-no-pointermove-expected.txt: Added.
* pointerevents/ios/click-no-pointermove.html: Added.
* pointerevents/utils.js:
(target_test):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (261245 => 261246)


--- trunk/LayoutTests/ChangeLog	2020-05-06 19:36:26 UTC (rev 261245)
+++ trunk/LayoutTests/ChangeLog	2020-05-06 19:57:34 UTC (rev 261246)
@@ -1,3 +1,19 @@
+2020-05-06  Antoine Quint  <[email protected]>
+
+        pointermove event sometimes has incorrect pointerType of 'mouse' on touch interactions
+        https://bugs.webkit.org/show_bug.cgi?id=210716
+        <rdar://problem/62084817>
+
+        Reviewed by Darin Adler.
+
+        Add a new test that checks that with content observation enabled a tap on a <button> element
+        dispatches synthetic mousemove and click events but no pointermove event.
+
+        * pointerevents/ios/click-no-pointermove-expected.txt: Added.
+        * pointerevents/ios/click-no-pointermove.html: Added.
+        * pointerevents/utils.js:
+        (target_test):
+
 2020-05-06  Ryan Haddad  <[email protected]>
 
         Two 'tests' are running with out expectation files that are not real tests.

Added: trunk/LayoutTests/pointerevents/ios/click-no-pointermove-expected.txt (0 => 261246)


--- trunk/LayoutTests/pointerevents/ios/click-no-pointermove-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/click-no-pointermove-expected.txt	2020-05-06 19:57:34 UTC (rev 261246)
@@ -0,0 +1,3 @@
+
+PASS Testing that a synthetic click event does not dispatch a pointermove event for the synthetic mousemove event. 
+

Added: trunk/LayoutTests/pointerevents/ios/click-no-pointermove.html (0 => 261246)


--- trunk/LayoutTests/pointerevents/ios/click-no-pointermove.html	                        (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/click-no-pointermove.html	2020-05-06 19:57:34 UTC (rev 261246)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+
+'use strict';
+
+if (window.internals)
+    internals.settings.setContentChangeObserverEnabled(true);
+
+target_test({ name: "button", width: "200px", height: "200px" }, async (target, test) => {
+    const eventTracker = new EventTracker(target, ["pointermove", "mousemove", "click"]);
+
+    // Tap and allow some time for the "click" event to be dispatched and for the double-tap
+    // delay to expire such that this test doesn't prevent the next test from receiving a tap.
+    await UIHelper.tapAt(100, 100);
+    await UIHelper.delayFor(100);
+
+    eventTracker.assertMatchesEvents([
+        { type: "mousemove" },
+        { type: "click" },
+    ]);
+    test.done();
+}, `Testing that a synthetic click event does not dispatch a pointermove event for the synthetic mousemove event.`);
+
+</script>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/LayoutTests/pointerevents/utils.js (261245 => 261246)


--- trunk/LayoutTests/pointerevents/utils.js	2020-05-06 19:36:26 UTC (rev 261245)
+++ trunk/LayoutTests/pointerevents/utils.js	2020-05-06 19:57:34 UTC (rev 261246)
@@ -12,6 +12,7 @@
     let continutation = args[impliedOptions ? 0 : 1];
     let description = args[impliedOptions ? 1 : 2];
 
+    options.name = options.name || "div";
     options.x = options.x || 0;
     options.y = options.y || 0;
     options.width = options.width || "100%";
@@ -24,7 +25,7 @@
 
 function makeTarget(test, options)
 {
-    const target = document.body.appendChild(document.createElement("div"));
+    const target = document.body.appendChild(document.createElement(options.name));
     target.setAttribute("style", `
         position: absolute;
         left: ${options.x};

Modified: trunk/Source/WebKit/ChangeLog (261245 => 261246)


--- trunk/Source/WebKit/ChangeLog	2020-05-06 19:36:26 UTC (rev 261245)
+++ trunk/Source/WebKit/ChangeLog	2020-05-06 19:57:34 UTC (rev 261246)
@@ -1,3 +1,20 @@
+2020-05-06  Antoine Quint  <[email protected]>
+
+        pointermove event sometimes has incorrect pointerType of 'mouse' on touch interactions
+        https://bugs.webkit.org/show_bug.cgi?id=210716
+        <rdar://problem/62084817>
+
+        Reviewed by Darin Adler.
+
+        Set the SyntheticClickType to OneFingerTap when creating a synthetic "mousemove" event for a synthetic "click" event as part of a tap.
+        On top of being more indicative of the actual action that triggered the synthetic event, it also has the added quality that it will
+        not yield a "pointermove" event.
+
+        Test: pointerevents/ios/click-no-pointermove.html
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::dispatchSyntheticMouseMove):
+
 2020-05-06  John Wilander  <[email protected]>
 
         Exempt app-bound domains from ITP's website data deletion and third-party cookie blocking between themselves

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (261245 => 261246)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-05-06 19:36:26 UTC (rev 261245)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-05-06 19:57:34 UTC (rev 261246)
@@ -658,7 +658,7 @@
     auto ctrlKey = modifiers.contains(WebEvent::Modifier::ControlKey);
     auto altKey = modifiers.contains(WebEvent::Modifier::AltKey);
     auto metaKey = modifiers.contains(WebEvent::Modifier::MetaKey);
-    auto mouseEvent = PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, WebCore::NoTap, pointerId);
+    auto mouseEvent = PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, WebCore::OneFingerTap, pointerId);
     // FIXME: Pass caps lock state.
     mainFrame.eventHandler().dispatchSyntheticMouseMove(mouseEvent);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to