-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cssom-view] elementFromPoint etc need to be defined in terms of layout and visual viewports #1378
Comments
FYI @RByers |
This is a specific instance of the broader problem described in #505. |
I've tried to document what Blink and Edge did for every API possibly related to viewports, see this sheet the *FromPoint APIs in Blink all take their arguments in layout-relative coordinates and clip to the layout viewport. |
Thanks @bokand, I think there's interop here, and I expect Blink inherited that from WebKit, so probably worth just specifying they use the layout viewport. |
Actually - the viewport split came after the WebKit fork so the implementations are independent. I had discussed these in the past with @smfr so I think elementFromPoint and friends are layout-relative in WebKit IIRC. As I recall, the point of difference was scroll-related properties like scrollX|Y|To, etc. In Blink they refer and mutate the layout viewport only but in WebKit they're the visual viewport. |
WebKit would like to move to the layoutViewport for scrollX/Y etc, if it's web-compatible. |
FWIW: Chrome made this change in M61 (see crbug.com/489206 - merged a bunch of bugs into that one that were fixed by this change). There were some complaints about this at the time (e.g. general feedback collected in crbug.com/571297 and crbug.com/767388 after we added IMHO, this actually went smoother than expected in terms of web-compat so I expect this should be doable in other engines as well. |
https://www.w3.org/TR/cssom-view-1/#dom-document-elementfrompoint
elementFromPoint(), elementsFromPoint() and caretPositionFromPoint() need to define whether the arguments are relative to the layout or visual viewports. Other "client" coordinates are being defined as being in terms of the layout viewport (e.g. getBoundingClientRects(), getClientRects(), event.clientX/y [citation needed]).
The spec also needs to define whether the clipping to the the viewport uses the layout or visual viewports for clipping.
The text was updated successfully, but these errors were encountered: