Title: [245506] trunk/LayoutTests
Revision
245506
Author
[email protected]
Date
2019-05-19 14:37:44 -0700 (Sun, 19 May 2019)

Log Message

[Pointer Events] The pointerup, pointerout and pointerleave events may be fired twice
https://bugs.webkit.org/show_bug.cgi?id=198028
<rdar://problem/50769425>

Reviewed by Dean Jackson.

Add a new test that checks that we're firing a "pointermove" event when the touch pressure
changes, even when the touch is stationary, and that a single "pointerup" event is fired
as the touch ends and the pressure changes. The relevant code change is done in WebKitAdditions.

* pointerevents/ios/pressure-change-expected.txt: Added.
* pointerevents/ios/pressure-change.html: Added.
* pointerevents/utils.js:
(prototype._handlePointerEvent):
(prototype.stationary):
(prototype._action):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (245505 => 245506)


--- trunk/LayoutTests/ChangeLog	2019-05-19 21:34:24 UTC (rev 245505)
+++ trunk/LayoutTests/ChangeLog	2019-05-19 21:37:44 UTC (rev 245506)
@@ -1,5 +1,24 @@
 2019-05-19  Antoine Quint  <[email protected]>
 
+        [Pointer Events] The pointerup, pointerout and pointerleave events may be fired twice
+        https://bugs.webkit.org/show_bug.cgi?id=198028
+        <rdar://problem/50769425>
+
+        Reviewed by Dean Jackson.
+
+        Add a new test that checks that we're firing a "pointermove" event when the touch pressure
+        changes, even when the touch is stationary, and that a single "pointerup" event is fired
+        as the touch ends and the pressure changes. The relevant code change is done in WebKitAdditions.
+
+        * pointerevents/ios/pressure-change-expected.txt: Added.
+        * pointerevents/ios/pressure-change.html: Added.
+        * pointerevents/utils.js:
+        (prototype._handlePointerEvent):
+        (prototype.stationary):
+        (prototype._action):
+
+2019-05-19  Antoine Quint  <[email protected]>
+
         [Pointer Events] A pointer should be marked as primary for all of its events
         https://bugs.webkit.org/show_bug.cgi?id=197909
         <rdar://problem/50801608>

Added: trunk/LayoutTests/pointerevents/ios/pressure-change-expected.txt (0 => 245506)


--- trunk/LayoutTests/pointerevents/ios/pressure-change-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/pressure-change-expected.txt	2019-05-19 21:37:44 UTC (rev 245506)
@@ -0,0 +1,3 @@
+
+PASS Pointer events are fired as pressure changes. 
+

Added: trunk/LayoutTests/pointerevents/ios/pressure-change.html (0 => 245506)


--- trunk/LayoutTests/pointerevents/ios/pressure-change.html	                        (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/pressure-change.html	2019-05-19 21:37:44 UTC (rev 245506)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script>
+
+'use strict';
+
+target_test((target, test) => {
+    target.style.touchAction = "none";
+    const eventTracker = new EventTracker(target, ["pointerdown", "pointermove", "pointerup"]);
+
+    const _one_ = ui.finger();
+    ui.sequence([
+        one.begin({ x: 10, y: 10 }),
+        one.stationary({ pressure: 500 }),
+        one.end(),
+    ]).then(() => {
+        eventTracker.assertMatchesEvents([
+            { id: 1, type: "pointerdown", x: 10, y: 10, pressure: 0 },
+            { id: 1, type: "pointermove", x: 10, y: 10, pressure: 1 },
+            { id: 1, type: "pointerup", x: 10, y: 10, pressure: 0 }
+        ]);
+        test.done();
+    });
+}, "Pointer events are fired as pressure changes.");
+
+</script>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/LayoutTests/pointerevents/utils.js (245505 => 245506)


--- trunk/LayoutTests/pointerevents/utils.js	2019-05-19 21:34:24 UTC (rev 245505)
+++ trunk/LayoutTests/pointerevents/utils.js	2019-05-19 21:37:44 UTC (rev 245506)
@@ -67,6 +67,7 @@
             type: event.type,
             x: event.clientX,
             y: event.clientY,
+            pressure: event.pressure,
             isPrimary: event.isPrimary,
             isTrusted: event.isTrusted
         });
@@ -237,14 +238,14 @@
 
     stationary(options)
     {
-        return this._action("stationary", options.x || 0, options.y || 0);
+        return this._action("stationary", options.x || this._lastX, options.y || this._lastY, options.pressure || 0);
     }
 
-    _action(phase, x, y)
+    _action(phase, x, y, pressure = 0)
     {
         this._lastX = x;
         this._lastY = y;
-        return { inputType: "finger", id: this.id, phase, x, y };
+        return { inputType: "finger", id: this.id, phase, x, y, pressure };
     }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to