Bug 287799
Summary: | Synthetic PointerEvent.offsetX/Y ignore scroll position | ||
---|---|---|---|
Product: | WebKit | Reporter: | Yehonatan Daniv <maggotfish> |
Component: | UI Events | Assignee: | Abrar Rahman Protyasha <a_protyasha> |
Status: | NEW | ||
Severity: | Normal | CC: | karlcow, maggotfish, nmouchtaris, richard_robinson2, simon.fraser |
Priority: | P2 | ||
Version: | Safari 18 | ||
Hardware: | Mac (Apple Silicon) | ||
OS: | macOS 14 |
Yehonatan Daniv
I've created a reduced reproduction: https://jsbin.com/qazizegafe/1/edit?html,css,js,output
Make sure you click "Run with JS" and scroll down to the target elements.
When hovering the transparent target the offsetY value is correct.
When hovering the semi-transparent yellow target the offsetY value is off by the amount of scrolled pixels of the container.
Currently workarounds for this bug exist but they are taxing performance-wise, which is really hurting a WebGL-based product we're trying to build.
This works correctly on Blink and Gecko, at least on my machine.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Yehonatan Daniv
Seems to be affecting only the root scroller: https://jsbin.com/nomehefuxo/1/edit?html,css,js,output
Also you can see in the link above that pageY is also affected the same way, as in not taking the window.scrollY into account.
Yehonatan Daniv
Probably related, Blink seem to be wrong when reporting pageX/Y on same scenario: https://issues.chromium.org/issues/397377457
Yehonatan Daniv
This issue and related spec change that's mentioned there is probably related: https://github.com/w3c/csswg-drafts/issues/8531