[webkit-dev] Enabling visual viewports by default
bokan at chromium.org
Tue Jan 10 12:03:59 PST 2017
Blink had a problem with mixing viewports between APIs. I've summarized the
situation in this doc:
Basically, some APIs (window.scroll_) currently refer to visual while
others (getBoundingClientRect) to the layout viewport. This mixing has led
to a long tail of bugs. Conceptually, we'd prefer to make everything
relative to the layout viewport. We tried this by shipping "inert visual
viewport" in M48 but got push back from web devs and reverted it.
I don't know what your new implementation does w.r.t. these APIs but since
you're making a big change this would be a good time to settle on the same
behavior. What do you think of the "inert" model described in the doc (and
available in Chrome via chrome://flags/#inert-visual-viewport)?
Essentially, it locks the UA, as far as the page can tell, into the fully
Edge engineers have expressed cautious support but were worried by the
compat impact. FWIW, we shipped for a whole milestone and didn't get any
reports of broken pages from users. We did get significant push back from
developers in http://crbug.com/571297 but it was mostly along the lines of
interop. If we could get all the engines on the same page I think it'd be a
significant improvement over the status quo.
In any case, we'll need to change one way or the other. Mixing the two
viewports in APIs is confusing devs and a source of bugs on existing pages.
The alternative is to make the "client" coordinates relative to the visual
viewport. Whatever we do, I'd like to improve interop by settling on the
same behavior between all the engines.
> Hi floks!
> I plan to enable visual viewports by default in WK1 and WK2 in the near future.
> "visual viewports" is new behavior for position:fixed and sticky elements under page zoom; they lay out relative to a "layout viewport" (which is the size of the initial containing block), while the user pans around in the "visual viewport". When the visual viewport hits the edge of the layout viewport, it pushes this around.
> This is a better user experience, and also matches Chrome and Firefox behavior more closely.
> Is there any platform which would object to having this new behavior by default? I hope to remove the non-visual-viewport code at some point.
> The master bug for this is https://bugs.webkit.org/show_bug.cgi?id=164260 <https://bugs.webkit.org/show_bug.cgi?id=164260>.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev