[macOS] Coalesced `pointerrawupdate` events report movementX/Y = 0 during pointer lock while the dispatched event carries the correct delta
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox-esr153 | --- | affected |
| firefox156 | --- | wontfix |
| firefox157 | --- | wontfix |
| firefox158 | --- | fixed |
People
(Reporter: jbedwell, Assigned: edgar)
References
(Regression)
Details
(Keywords: regression)
Attachments
(5 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36
Steps to reproduce:
- Open the attached test page on macOS
- Click the blue area to enter pointer lock
- Move the cursor continuously
This page shows a red cursor driven by dispatched events when the coalesced list is broken and a blue one driven strictly by the coalesced entries.
Actual results:
Observe the red cursor deviate from the blue cursor.
During pointer lock dispatched pointerrawupdate events report correct non-zero movement X/Y, but coalesced entries report movement X/Y = 0. The test page flags these as broken events. This reproduces in adjusted and unadjusted pointer lock modes.
Expected results:
Each coalesced pointerrawupdate entry reports movement X/Y which is equal to the sum of the coalesced event movements. Both cursors track the mouse, test page reports OK.
On macOS with pointer lock active, every entry returned by getCoalescedEvents() for a pointerrawupdate event reports movementX and movementY = 0, while the dispatched pointerrawupdate event itself reports the correct non-zero movement delta. The pointerrawupdate event movement delta should equal the sum of the movement delta of its coalesced events.
This affects applications that consume high frequency mouse input via pointerrawupdate + getCoalescedEvents() during pointer lock on macOS.
This appears to be the same class of issue as bugs 1829401 and 1987671 which concerned movement on the dispatched parent event. Based on https://github.com/w3c/pointerevents/issues/535 and behavior on Windows it appears that the behavior observed in this bug is not intended.
Testing done on macOS 26.6.2 + Firefox 155.0.0 / 155.0.1.
| Assignee | ||
Comment 3•17 days ago
|
||
Yes, this looks like a bug to me, I will take a look.
Comment 4•17 days ago
|
||
:edgar, is Bug 2036482 potentially the regressor here?
| Assignee | ||
Comment 5•17 days ago
|
||
Yes, I think so, I could not reproduce this after setting dom.pointer-lock.native-lock.enabled to false.
Updated•16 days ago
|
Comment 6•14 days ago
|
||
The bug has a release status flag that shows some version of Firefox is affected, thus it will be considered confirmed.
| Assignee | ||
Comment 7•13 days ago
•
|
||
(In reply to Edgar Chen [:edgar] from comment #5)
Yes, I think so, I could not reproduce this after setting
dom.pointer-lock.native-lock.enabledtofalse.
BTW, I see the same behavior on Linux, but setting dom.pointer-lock.native-lock.enabled to false doesn't help.
So it might be different root cause on Linux.
Edited:
Linux Wayland doesn't use that pref at all.
| Assignee | ||
Updated•11 days ago
|
| Assignee | ||
Comment 8•10 days ago
|
||
| Assignee | ||
Comment 9•10 days ago
|
||
ePointerRawUpdate never has coalesced widget events to report, so
EnsureFillingCoalescedEvents() synthesizes a single entry from the dispatched
event via InitCoalescedEventFromPointerEvent(), which copied every member but
mMovement.
| Assignee | ||
Comment 10•9 days ago
|
||
movementX and movementY are optional and have to be specified together.
Updated•7 days ago
|
Updated•6 days ago
|
| Assignee | ||
Comment 11•6 days ago
|
||
The expected result for coalesced event is based on current behavior, which may
be incorrect and will be fixed in subsequent patches.
Updated•6 days ago
|
| Assignee | ||
Comment 12•6 days ago
|
||
CanCoalesce() incorrectly required the movement deltas of both events to be
equal, so mousemove events carrying movement deltas were effectively never
coalesced.
| Assignee | ||
Comment 13•6 days ago
|
||
| Assignee | ||
Comment 14•5 days ago
|
||
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Comment 15•4 days ago
|
||
Comment 16•4 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/c672294d2d75
https://hg.mozilla.org/mozilla-central/rev/3c0523a23730
https://hg.mozilla.org/mozilla-central/rev/c91e97674283
https://hg.mozilla.org/mozilla-central/rev/b42c0de1a856
Updated•8 minutes ago
|
Description
•