Pointer movement should be reported as (0,0) when re-entering browser window

RESOLVED FIXED in mozilla18

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: cpearce, Assigned: cpearce)

Tracking

(Blocks 1 bug)

Trunk
mozilla18
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

The pointer lock's specification of MouseEvent.movement{X,Y} [ http://www.w3.org/TR/pointerlock/#attributes-1 ] says:

"When unlocked, the system cursor can exit and re-enter the user agent window. If it does so and the user agent was not the target of operating system mouse move events then the most recent pointer position will be unknown to the user agent and movementX/Y can not be computed and must be set to zero."

We don't do this. We should do this.

Steps to reproduce:

1. Go to http://people.mozilla.org/~eakhgari/pointerlock.html
2. Open the web console (CTRL + SHIFT + K)
3. Move the mouse outside of the browser window.
4. Move the mouse back inside the browser window at a different place than where it moved out of the browser window. Note the large movement reported in the web console log.

Expected result: No large movement, we should report (0,0) movement for the move that enters the browser window.
(Assignee)

Comment 1

7 years ago
Invalidate nsEventStateManager::sLastRefPoint when the pointer leaves the window, detect that, and cause mouse movement to be 0 upon the next movement.
Attachment #665253 - Flags: review?(bugs)
Attachment #665253 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/288a1c96c20b
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.