From 96bcb5181752dc4676e5094f8181f752dc680e27 Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Tue, 19 Mar 2024 06:27:42 +0000 Subject: [PATCH] Update the pointer boundary event tests in pointerevent_after_target_appended.html to align with the spec As discussed in https://github.com/web-platform-tests/interop/issues/380, the pointer boundary event should be fired only when the hoverable pointer is actually moved. Differential Revision: https://phabricator.services.mozilla.com/D204618 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1885223 gecko-commit: 5b2aa85f993f54ee31e8b5f401714e38bd8705b4 gecko-reviewers: masayuki --- .../pointerevent_after_target_appended.html | 66 ++++++++++++++----- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/pointerevents/pointerevent_after_target_appended.html b/pointerevents/pointerevent_after_target_appended.html index 5d73702aca8744..02d06c37f881fc 100644 --- a/pointerevents/pointerevent_after_target_appended.html +++ b/pointerevents/pointerevent_after_target_appended.html @@ -92,6 +92,9 @@ let actions = new test_driver.Actions() .addPointer("TestPointer", pointer_type) + // The offset argument of pointerMove action is relative to the + // central point of the origin element. So this moves the pointer to + // the parent actually. .pointerMove(-30, -30, {origin: parent}) .pointerDown() .pointerUp() @@ -133,6 +136,9 @@ let actions = new test_driver.Actions() .addPointer("TestPointer", pointer_type) + // The offset argument of pointerMove action is relative to the + // central point of the origin element. So this moves the pointer to + // the parent actually. .pointerMove(-30, -30, {origin: parent}) .pointerDown() .pointerUp() @@ -158,14 +164,28 @@ setup(); // Tests for dispatched pointer events. - addPromiseTestForNewChild("pointerdown", "pointer", [ - "pointerover@parent", "pointerenter@parent", - "pointerdown@parent", "(child-attached)", - "pointerout@parent", "pointerover@child", "pointerenter@child", - "pointerup@child", - "pointerdown@child", "pointerup@child", - "pointerout@child", "pointerleave@child", "pointerleave@parent" - ]); + addPromiseTestForNewChild( + "pointerdown", + "pointer", + pointer_type == "mouse" + // Pointer boundary events should be fired only when the hoverable pointer + // is actually moved and pointerup doesn't imply the pointer move. + ? [ + "pointerover@parent", "pointerenter@parent", + "pointerdown@parent", "(child-attached)", "pointerup@child", + "pointerout@parent", "pointerover@child", "pointerenter@child", + "pointerdown@child", "pointerup@child", + "pointerout@child", "pointerleave@child", "pointerleave@parent" + ] + : [ + "pointerover@parent", "pointerenter@parent", + "pointerdown@parent", "(child-attached)", + "pointerout@parent", "pointerover@child", "pointerenter@child", + "pointerup@child", + "pointerdown@child", "pointerup@child", + "pointerout@child", "pointerleave@child", "pointerleave@parent" + ] + ); addPromiseTestForNewChild("pointerup", "pointer", [ "pointerover@parent", "pointerenter@parent", "pointerdown@parent", "pointerup@parent", "(child-attached)", @@ -173,14 +193,28 @@ "pointerdown@child", "pointerup@child", "pointerout@child", "pointerleave@child", "pointerleave@parent" ]); - addPromiseTestForMovedChild("pointerdown", "pointer", [ - "pointerover@child", "pointerenter@parent", "pointerenter@child", - "pointerdown@child", "(child-moved)", - "pointerover@child", "pointerenter@child", - "pointerup@child", - "pointerdown@child", "pointerup@child", - "pointerout@child", "pointerleave@child", "pointerleave@parent" - ]); + addPromiseTestForMovedChild( + "pointerdown", + "pointer", + pointer_type == "mouse" + // Pointer boundary events should be fired only when the hoverable pointer + // is actually moved and pointerup doesn't imply the pointer move. + ? [ + "pointerover@child", "pointerenter@parent", "pointerenter@child", + "pointerdown@child", "(child-moved)", "pointerup@child", + "pointerover@child", "pointerenter@child", + "pointerdown@child", "pointerup@child", + "pointerout@child", "pointerleave@child", "pointerleave@parent" + ] + : [ + "pointerover@child", "pointerenter@parent", "pointerenter@child", + "pointerdown@child", "(child-moved)", + "pointerover@child", "pointerenter@child", + "pointerup@child", + "pointerdown@child", "pointerup@child", + "pointerout@child", "pointerleave@child", "pointerleave@parent" + ] + ); addPromiseTestForMovedChild("pointerup", "pointer", [ "pointerover@child", "pointerenter@parent", "pointerenter@child", "pointerdown@child", "pointerup@child", "(child-moved)",