Files
tubestation/testing
Masayuki Nakano 66ee19892a Bug 1966551 - Make PointerEventHandler::DispatchPointerFromMouseOrTouch() dispatch synthesized ePointerMove for synthesized eMouseMove if it's caused by hoverable pointer r=smaug
Currently, we don't dispatch synthesized `ePointerMove` unless it's
required for dispatch the boundary events after dispatching
`ePointerLostCapture` event [1] since Pointer Events defined that the
boundary events should be fired only when before dispatching a pointer
event.  However, it's changed, Point Events currently defines that the
boundary events should be fired if the element under the pointer is
changed without a `pointermove` [2] if and only if the pointer supports
hover.

Therefore, this patch makes `PresShell` store the last input source
whose event set the mouse location at last and
`PresShell::ProcessSynthMouseMoveEvent()` sets the input source to make
`PointerEventHandler::DispatchPointerFromMouseOrTouch()` can consider
whether it needs to dispatch pointer boundary events or not for the
pointer.

Additionally, the mochitests for the manual WPTs under
`dom/events/test/pointerevents` checks `pointerId`.  Therefore, this
patch makes `PresShell` also store the last `pointerId` and set it to
the synthesized `eMouseMove` too.

I think that this approach is **not** correct approach to fix this bug
because there could be multiple hoverable pointers, but we synthesize
pointer boundary events only for the last input device.  I think it's
enough for now because we've not supported pen well (we've not supported
the test API yet!), so, we only support only mouse input well as
hoverable inputs.  I think we should extend `PointerInfo` and make a
synthesizer of `ePointerMove` later.

Note that this patch changes 2 WPTs which both are in the scope of
Interop.

The expectation of
`pointerevent_pointer_boundary_events_after_removing_last_over_element.html`
needs to be changed for conforming to the latest spec.  I wrote this
test before the spec change and it wasn't updated when the spec is
changed. I filed this issue to interop [3].

The changes for `pointerevent_pointerout_no_pointer_movement.html` is
required for avoiding the timeout.  Gecko does not allow recursive
synthesized `eMouseMove` to prevent infinite reflow loops without moving
the mouse cursor.  However, the test expects that and that causes
requiring the hack for Chrome too.  Therefore, I split the test to
make each step run in different event loop and I removed the hack for
Chrome.

Note that this patch also removes 2 sets of mochitests for WPT manual
tests because they are now tested with the test driver [4][5] and they
fail without maintained.

1. https://searchfox.org/mozilla-central/rev/f571db8014431de31d245017e2f5457046aec4ea/dom/events/PointerEventHandler.cpp#494-503
2. https://w3c.github.io/pointerevents/#boundary-events-caused-by-layout-changes
3. https://github.com/web-platform-tests/interop/issues/961
4. https://wpt.fyi/results/pointerevents/pointerevent_boundary_events_in_capturing.html%3Fmouse?label=master&label=experimental&aligned&view=interop
5. https://wpt.fyi/results/pointerevents/pointerevent_releasepointercapture_events_to_original_target.html%3Fmouse?label=master&label=experimental&aligned&view=interop

Differential Revision: https://phabricator.services.mozilla.com/D250421
2025-05-22 05:46:55 +00:00
..

Common testing tools for mozilla codebase projects, test suite definitions
for automated test runs, tests that don't fit anywhere else, and other fun
stuff