Open Bug 2087397 Opened 21 days ago Updated 14 days ago

With async mouse events a pointer move to viewport (0,0) dispatches a mousemove event on desktop

Categories

(Remote Protocol :: Agent, defect, P2)

defect
Points:
2

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:m23])

Discovered when investigating bug 2049270.

When remote.events.async.mouse.enabled is true, an initial pointerMove action to the viewport coordinates (0,0) dispatches a mousemove event on desktop. Per the WebDriver spec the pointer input source starts at (0,0), so moving to that position must not emit any event.

This affects both WebDriver classic and WebDriver BiDi:

  • /webdriver/tests/classic/perform_actions/pointer_mouse.py | test_move_to_position_in_viewport[default value]
  • /webdriver/tests/bidi/input/perform_actions/pointer_mouse.py | test_move_to_position_in_viewport[default value]

Both tests expect 0 events, but get 1 on desktop when the async variant is used. With synchronous dispatch in the content process, and on Android with async dispatch, no event is emitted and the tests pass.

With async dispatching PointerMoveAction.dispatch converts the target from viewport coordinates into browser window coordinates via toBrowserWindowCoordinates. On desktop the content area is offset by the toolbars (and sidebars if visible), so viewport (0,0) maps to a different position than the initial (0,0) of the input source. As a result the early return in PointerMoveAction.performPointerMoveStep, which skips the move when the target matches the current position, is never hit. On Android with the TestRunner package (we would have seen this with Fenix but require bug 1880800 fixed first) the content fills the whole window, so there is no offset and the positions match.

It needs investigation how the initial pointer position and the converted target coordinates should be handled so that the browser chrome is correctly excluded from the comparison. As it looks like there is still a bug in our calculation.

Steps to reproduce:
./mach wpt --headless --test-type=wdspec --setpref=remote.events.async.mouse.enabled=true testing/web-platform/tests/webdriver/tests/classic/perform_actions/pointer_mouse.py

Points: --- → 2
Priority: -- → P2
Whiteboard: [webdriver:m23]

The severity field is not set for this bug.
:whimboo, could you have a look please?

For more information, please visit BugBot documentation.

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