Files
ladybird/Tests/LibWeb/Text/expected/UIEvents/MouseEvent-constructed-coordinates.txt
Andreas Kling 12af95cfa2 LibWeb: Floor coordinates for untrusted MouseEvent and PointerEvent
Per the PointerEvents spec and Chromium's behavior, untrusted (JS-
constructed) MouseEvent coordinates should be floored to integers.

PointerEvent overrides this behavior: for non-click types (pointerdown,
pointermove, etc.), fractional coordinates are preserved. For click,
auxclick, and contextmenu events, coordinates are floored via the
MouseEvent base class.

Trusted events (created by the user agent) always preserve fractional
coordinate values.
2026-03-08 18:09:10 +01:00

19 lines
522 B
Plaintext

MouseEvent screenX: 30
MouseEvent screenY: 40
MouseEvent clientX: 10
MouseEvent clientY: 20
MouseEvent pageX: 10
MouseEvent pageY: 20
MouseEvent offsetX: 10
MouseEvent offsetY: 20
PointerEvent pointerdown screenX: 0.111
PointerEvent pointerdown clientX: 5.25
PointerEvent pointerdown pageX: 5.25
PointerEvent pointerdown offsetX: 5.25
PointerEvent click screenX: 0
PointerEvent click clientX: 5
PointerEvent click pageX: 5
PointerEvent click offsetX: 5
PointerEvent auxclick clientX: 5
PointerEvent contextmenu clientX: 5