Skip to content
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

Layout viewport vs visual viewport #266

Closed
nolanlawson opened this issue Nov 8, 2017 · 6 comments
Closed

Layout viewport vs visual viewport #266

nolanlawson opened this issue Nov 8, 2017 · 6 comments

Comments

@nolanlawson
Copy link
Member

Currently in the spec it says:

Note: Root intersection rectangle is not affected by pinch zoom and will report the unadjusted viewport, consistent with the intent of pinch zooming (to act like a magnifying glass and NOT change layout.)

This seems to imply that the default root is the layout viewport, not the visual viewport.

However, during TPAC 2017, the Web Perf WG discussed Element Timing (notes) and came to the conclusion that it would be useful to define Element Timing in terms of Intersection Observer (as a "declarative Intersection Observer"). This doesn't seem possible, however, if the default root is the layout viewport, and there's no way to use the visual viewport instead.

Should IntersectionObserver allow using either the layout viewport or the visual viewport as the root? Alternatively, is "layout viewport by default" the behavior we want?

@nolanlawson
Copy link
Member Author

This discussion came up again as we're updating our implementation. The visual viewport seems to make the most sense, especially for things like Hero/Element Timing polyfills (e.g. @tdresser's polyfill here.) However, we're currently planning to stick with the layout viewport for compatibility reasons.

Do other UAs intend to stick with the layout viewport?

@tdresser
Copy link

@ojanvafai @bokand

@bokand
Copy link

bokand commented Dec 14, 2017

IIRC, Edge currently uses the visual viewport. We definitely should either align with them or add the option to use visual. @szager-chromium

@ojanvafai
Copy link
Collaborator

Sorry, it turns out I misspoke at TPAC. I thought we had resolved this by adding an option to choose whether you want visual or layout. Didn't remember it got stuck on the question for which one should be the default.

#95 is where the discussion for this is. Should we dupe this to that issue?

@zcorpan
Copy link
Member

zcorpan commented May 8, 2020

This issue came up in the discussion for <img loading=lazy> whatwg/html#5408 (comment)

@miketaylr
Copy link
Member

#95 is where the discussion for this is. Should we dupe this to that issue?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants