<div dir="ltr"><div>Hi Simon,</div><div><br></div><div>Blink had a problem with mixing viewports between APIs. I've summarized the situation in this doc:</div><div><a href="https://docs.google.com/document/d/1E6tBwLF1UlqSCMyIIemaRheJrtLncsNetV7y6we-muE/edit?usp=sharing">https://docs.google.com/document/d/1E6tBwLF1UlqSCMyIIemaRheJrtLncsNetV7y6we-muE/edit?usp=sharing</a><br></div><div><br></div><div>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.</div><div><br></div><div>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 zoomed-out state.</div><div><br></div><div>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 <a href="http://crbug.com/571297">http://crbug.com/571297</a> 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. </div><div><br></div><div>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.</div><div><br></div><div>Thanks,</div><div>David</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><pre style="color:rgb(0,0,0)">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 <a href="https://bugs.webkit.org/show_bug.cgi?id=164260">https://bugs.webkit.org/show_bug.cgi?id=164260</a> <<a href="https://bugs.webkit.org/show_bug.cgi?id=164260">https://bugs.webkit.org/show_bug.cgi?id=164260</a>>.
Simon</pre></blockquote></div>