Closed Bug 1961318 Opened 1 year ago Closed 1 year ago

Failing WPT in pointerevent_setpointercapture_inactive_button_mouse.html in wpt.fyi

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

All
Linux
defect

Tracking

()

RESOLVED FIXED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 2 open bugs, )

Details

Attachments

(1 file)

pointerevent_setpointercapture_inactive_button_mouse.html fails in wpt.fyi, however, looks like that it passes on our CI.

The test tries to capture the pointer within the pointerover listener when no button is pressed.

Element.setPointerCapture() is defined as

The pointer MUST be in its active buttons state for this method to be effective, otherwise it fails silently.

However, we failed the test with an exception:

FAIL message: NotFoundError: Element.setPointerCapture: Invalid pointer id

On the other hand, "Setting pointer capture" section defines

If the pointerId provided as the method's argument does not match any of the active pointers, then throw a "NotFoundError" DOMException.

as its first step.

"active pointers" is defined as

Any touch contact, pen/stylus, mouse cursor, or other pointer that can produce events. If it is possible for a given pointer (identified by a unique pointerId) to produce additional events within the document, then that pointer is still considered active. Examples:

  • A mouse connected to the device is always active.

Currently, we register mouse pointer only while the cursor is over the document. That requires eMouseEnterIntoWidget event before the pointerover, but it's not guaranteed that it's fired before the first synthesized mouse move.

So, perhaps, we need to register pointer if we synthesize a mouse move over a document. However, we cannot unregister it automatically. Therefore, I think it should have a bool flag and if it's required, PointerEventHandler::GetPointerInfo() callers should check whether it gets proper pointer info.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED

Despite the name, sActivePointersIds is a list of all pointers which is either
active or inactive.

Element::SetPointerCapture checks whether the given pointerId is known one
or not. However, we register mouse pointer when entering over the document
and unregister it when leaving from the document.

However, they are handled when eMouseEnterIntoWidget and
eMouseExitFromWidget are fired, however, they are not fired automatically
if the mouse events are synthesized on a document which does not contain the
system cursor position.

So, we need to make the method register the PointerInfo when
EventStateManager receives eMouseOver or ePointerMove which is caused only
by mouse.

For making any PointerEventHandler::GetPointerInfo() callers can distinguish
whether the pointer is registered or updated by a synthesized mouse events,
PointerInfo should have the information as a bool member.

I think the pref setting is not used in wpt.fyi. That must be the reason why this test fails in the environment but passes in our CI.

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/caa8ce8bc2e9 Make `PointerEventHandler::UpdateActivePointerState` register synthesized mouse info if there is not r=edgar,dom-core

Backed out for causing build bustages @ PointerEventHandler.cpp

Flags: needinfo?(masayuki)

Really, really odd compile error for me because I changed the type to bool from a bit field with !!....

Flags: needinfo?(masayuki)
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/574356d50559 Make `PointerEventHandler::UpdateActivePointerState` register synthesized mouse info if there is not r=edgar,dom-core
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 139 Branch
QA Whiteboard: [qa-triage-done-c140/b139]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: