Bug 235116 - Summing up all movementX of mousemove events does not give the total difference in position
Summary: Summing up all movementX of mousemove events does not give the total differen...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: Safari 15
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2022-01-12 08:56 PST by Guillaume
Modified: 2022-01-21 17:46 PST (History)
4 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume 2022-01-12 08:56:41 PST
The specification of the MouseEvent.movementX/Y properties says that

> All motion data must be delivered via mousemove events such that between any two mouse events earlierEvent and currentEvent the value of currentEvent.screenX-earlierEvent.screenX is equivalent to the sum of all movementX movementY/code> events after earlierEvent, with the exception of when screenX can not be updated because the pointer is clipped by the user agent screen boundaries.
(see https://w3c.github.io/pointerlock/#dom-mouseevent-movementx)

It works perfectly fine in Chrome but does not seem to work as expected in Safari, as soon as I move the mouse I get differences of several hundreds of pixels.
See the following CodePen: https://codepen.io/Latcarf/pen/YzrRvZE

Tested with Safari Version 15.1 (15612., 15612), on MacOS Catalina version 10.15.7 (19H1615).
Comment 1 Radar WebKit Bug Importer 2022-01-19 08:57:15 PST
Comment 2 Wenson Hsieh 2022-01-21 17:46:58 PST
`WebPageProxy::handleMouseEvent` drops unhandled platform mousemove events on macOS if the mouse event queue is too backed up…

Maybe that is what's causing this behavior?