Closed Bug 1987671 Opened 7 months ago Closed 4 months ago

pointerrawupdate event does not set movementX/Y

Categories

(Core :: DOM: Events, defect)

Firefox 142
defect

Tracking

()

RESOLVED FIXED
148 Branch
Tracking Status
firefox148 --- fixed

People

(Reporter: ashley, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, webcompat:platform-bug)

User Story

user-impact-score:400

Attachments

(2 files)

Attached file test.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0

Steps to reproduce:

When the pointerrawupdate event fires, in Firefox the movementX and movementY properties are always 0. In Chrome these values are set to reflect the pointer movement similar to the regular pointermove events.

Actual results:

Pointer event movementX/Y properties always 0 in pointerrawupdate events

Expected results:

Pointer event movementX/Y properties to reflect actual pointer movement in pointerrawupdate events

Component: Untriaged → DOM: Events
Product: Firefox → Core
Severity: -- → S3

I'll post a patch soon.

Assignee: nobody → masayuki
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Although this has not been standardized yet [1][2]. However, Chromium
has already supported this and that must be reasonable for web
developers.

This patch adds the support with a new pref.

However, as written with XXX comment, I think movementX and
movementY of pointermove and pointerrawupdate should be stored per
pointerId. However, let's keep the existing way for pointermove for
now.

  1. https://github.com/w3c/pointerlock/issues/100
  2. https://github.com/w3c/pointerevents/issues/535
User Story: (updated)
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch

(In reply to Sebastian Zartner [:sebo] from comment #5)

Sounds like https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/movementX and https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/movementY

Right, and oh, they explain the non-zero values are not available with pointermove. That is currently wrong.
https://w3c.github.io/pointerlock/#extensions-to-the-mouseevent-interface

movementX and movementY must be zero for all mouse events except mousemove and pointermove.

And the values of pointerrawupdate are difference from the preceding pointerrawupdate or pointermove. If multiple pointerrawupdate events are fired between 2 pointermove events, 1st one has the difference from the previous pointermove but the others have the difference from the previous pointerrawupdate.

And I believe that they for pointermove and pointerrawupdate should have the difference from preceding pointermove or pointerrawupdate whose pointerId is the same one. However, at least, Gecko does not work so for now. However, this thing is not mentioned in the any specs such as Pointer Lock 2.0 nor Pointer Events.

QA Whiteboard: [qa-triage-done-c149/b148]

FF148 MDN work for this can be tracked in https://github.com/mdn/content/issues/42752. It is complete, but I'd welcome a sanity check on https://github.com/mdn/content/pull/42929 and https://github.com/mdn/browser-compat-data/pull/28920?

Flags: needinfo?(sebastianzartner)

Did the review. From my side the changes look fine. Thank you, Hamish! Masayuki, maybe you can also have a quick look in case I missed anything?

Sebastian

Flags: needinfo?(sebastianzartner) → needinfo?(masayuki)

Yeah, the text looks fine, I don't know about the structure change of the document (increasing some headings, etc).

Thank you!

Flags: needinfo?(masayuki)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: