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
Inabox: Support layers #17823
Inabox: Support layers #17823
Conversation
Layers returns scroll relative layout boxes.
354bbf6
to
62b4e36
Compare
@@ -177,9 +180,14 @@ export class ViewportBindingInabox { | |||
/** @override */ | |||
getLayoutRect(el) { | |||
const b = el./*OK*/getBoundingClientRect(); | |||
let {left, top} = b; | |||
if (this.useLayers_) { | |||
left -= this.viewportRect_.left; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain why do we offset with viewportRect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, is layer's coordinate system relative to viewport instead of doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Layer’s rects should exactly match getBoundingClientRect
(with rounding) in every circumstance.
In this case, we need to factor in that the is relative to a viewport in a parent document.
* Inabox: Support layers Layers returns scroll relative layout boxes. * Add import
Layers returns scroll relative layout boxes.
Fixes #17825