Skip to content

Commit

Permalink
Update the pointer boundary event tests in pointerevent_after_target_…
Browse files Browse the repository at this point in the history
…appended.html to align with the spec

As discussed in web-platform-tests/interop#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
  • Loading branch information
EdgarChen authored and moz-wptsync-bot committed Mar 19, 2024
1 parent 6af6dbf commit 96bcb51
Showing 1 changed file with 50 additions and 16 deletions.
66 changes: 50 additions & 16 deletions pointerevents/pointerevent_after_target_appended.html
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -158,29 +164,57 @@
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)",
"pointerout@parent", "pointerover@child", "pointerenter@child",
"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)",
Expand Down

0 comments on commit 96bcb51

Please sign in to comment.