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

Value of scale for iframes is unclear in the spec #52

Open alijuma opened 6 years ago

alijuma commented 6 years ago

Chrome always returns scale 1 for iframes, and this is also covered by viewport-scale-iframe-manual.html. But it's not clear that the spec language at https://wicg.github.io/visual-viewport/index.html#dom-visualviewport-scale implies this. Does this follow from the math given there or do we need to add a special case?

This came up in a WebKit review (https://bugs.webkit.org/show_bug.cgi?id=179385#c7).

bokand commented 6 years ago

Yes, the intent is that an iframe's visual viewport doesn't have any scale of its own when the page is zoomed. You could imagine if we ever added per-iframe based zoom it would be non-1. The meaning of it is that it's "the scale relative to the parent frame". I'll make the spec clearer on this point.