Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Parallel API for layout viewport? #16
Should there be a parallel API for layout viewport?
A couple reasons this might be interesting:
My preference is to make all the ambiguous APIs relative to the layout viewport. This would make
We already so some aliasing with
The other (probably separate) issue I see here is that we should be clear about how we define the layout viewport. As far as I can tell, position: fixed elements in Edge stick to the box defined by the 's
I may have contradicted myself a bit with my last paragraph there. Because Chrome's "layout viewport" isn't actually tied to layout, the only way to get the layout viewport size, in general, is to create a phantom position: fixed element with width/height 100% and read that with getBoundingClientRect.
On a "well behaved" web page this isn't actually needed, and even on more tricky pages I think scrollingElement.clientWidth/Height will work today but we have some experiments where this might change. e.g. make the URL bar behave more like Safari where the scrollingElement's size doesn't change with the URL bar. An explicit API might help us here.