WICG / visual-viewport

A proposal to add explicit APIs to the Web for querying and setting the visual viewport
https://wicg.github.io/visual-viewport/
MIT License
177 stars 28 forks source link

Is visualViewport useful for iframes? #55

Open theres-waldo opened 6 years ago

theres-waldo commented 6 years ago

We're looking at implementing the Visual Viewport API in Firefox. One thing we noticed was that the spec seems to define visualViewport for iframes as well. Is that useful? My understanding is that iframes don't have distinct notions of visual and layout viewports, since they cannot be zoomed.

bokand commented 6 years ago

That's correct. The reason it's defined in iframes is for correct composition. If you take a page that uses the visualViewport and embed it in an iframe it should still function. You can think of an iframe as having an immutable visualViewport since it (today) can't be pinch-zoomed independently of the main frame. However, all the properties and operations are still well-defined.