Re: [w3c/uievents] Define what layerX/layerY do in presence of transforms. (Issue #398)

emilio left a comment (w3c/uievents#398)

> In which case, is it feasible to just match Chromium/WebKit?

Dunno, what are you doing exactly? Your behavior is rather confusing to me. I can certainly match you in this case, but the implementation [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/events/mouse_event.cc;l=464;drc=e18a32c4b96ad2b2c2f50195936594d1f7c4f62a) is a bit confusing...

You start with `pageX/Y`, then move them around... But what are the semantics of this [kIgnoreTransforms](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/events/mouse_event.cc;l=518;drc=e18a32c4b96ad2b2c2f50195936594d1f7c4f62a?q=::layerX) for example?

Would you be able to define precisely what you're doing / in which coordinate space are you operating?

In Firefox, what we're doing is basically making the coordinates relative to the closest abspos container or scroller, in the coordinate space of that abspos container / scroller.

It seems you might be returning them in the "page" coordinate space (which seems wrong to me, but ok), but I'm not convinced from the code there aren't more subtleties.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/398#issuecomment-3061625627
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/uievents/issues/398/3061625627@github.com>

Received on Friday, 11 July 2025 10:07:24 UTC