Open Bug 1295118 Opened 8 years ago Updated 2 years ago

mousemove event doesnt fire if mouse is at farest right positon (x axis)

Categories

(Core :: DOM: Events, defect, P3)

51 Branch
defect

Tracking

()

People

(Reporter: manuelbaesler, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160726073904

Steps to reproduce:

enter into the console

document.addEventListener('mousemove', (ev) => console.log(ev.clientX, ev.clientY) );

move mouse to farest right positon
move up and down
-> no mousemove event fires


Actual results:

no mousemove event


Expected results:

mousemove should fire events for mousemovement on the farest right positon

Example:
open firefox in fullscreenmodus, enter the line into the console

document.addEventListener('mousemove', (ev) => console.log(ev.clientX, ev.clientY) );

move the cursor to the farest right position and move up and down.
you wont get any output.

This problem does not occure in Chrome, Opera nor Safari. They all report on farest right up down movement x=2879, which is correct sine farest left position x=0 and screen dimension is x=2880.

Also tested with firefox nightly build.
Might this be related to bug 50511?
Component: Untriaged → DOM: Events
I observed this issue on FF48. Also, it seems the dimension detection is wrong that the position on the far right should have been 1279 on my screen, while I observed numbers more than 1400.

Would you please take a look, Stone?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(sshih)
Assignee: nobody → sshih
Flags: needinfo?(sshih)
Priority: -- → P3
Only happens on Mac. OK on Windows and Linux.
When the window is maximized on windows, the x range of mousemove is 0-1919 on my pc. The document size is 1920. We can not move outside of the window nor receive mouseout.
Tested on Mac, we fire mouseout in x=0 or 1440. The document width=1440. The x range of mousemove is 3-1437.

Test on chrome (Windows), the document width is 1920, the x range of mousemove is 0~1919. Chrome reports mouseout in x=0 or 1919.
Test on chrome (Mac), the document width is 1440, the x range of mousemove is 0~1439. Chrome reports mouseout in x=0 or 1439.

When moving mouse to the left most or right most position, chrome will fire mouseout, mouseover, then mouse move. Safari behave the same as Chrome
In full screen mode, we fire mouseout in right most position but not in left most position. The EventStateManager::mCurrentTarget is ViewportFrame when mousemove in the right most position and nsSubDocumentFrame in the left most position.
In the case of moving mouse to right most position in full screen mode, PresShell [1] call FindFrameTargetedByInputEvent to get frame for the event with position=right most point. I find it calls nsLayoutUtils::GetFramesForArea to find the hit frames but no frame hit. That induce the event is dispatch to ViewportFrame (set in [2])

[1] https://dxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#7621
[2] https://dxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#7425

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: stone123456 → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.