Re: [OT] Allow auto-resize on iframe

I’m afraid I have to agree with Craig here. I find it very worrying that many implementors lately seem to continuously be in favor of JavaScript solutions. Assuming that everyone who is comfortable with HTML/CSS is also comfortable with JavaScript is false. In fact, at least 1 out of 2 HTML/CSS authors are NOT particularly comfortable with JS [1]. I hope we're not going towards a Web platform that requires everyone to be a programmer to create on it. Learning and using declarative languages is much easier, for everyone. A lot of the time, programmers also prefer the declarative solution if one is available.

I also agree with Craig about how this is *not* a marginal benefit to authors. It's something every author has stumbled on. Wanting scrollbars in an iframe is the edge case, whereas autoresizing is usually the desired behavior. In addition, the hackiness of current solutions does not just produce a minor stylistic annoyance, it actively degrades the usability and accessibility of the page. Sure, it's not the most important feature request ever, but I'd say it would be pretty high in many authors' wishlists.

height: max-content is a very elegant solution, so I really hope it's possible.

I'm a bit ambivalent about resolving media queries based on the parent document. If these media queries do anything reasonable, they probably change the design of the included page to look good at a certain size. Imagine showing a page intended for huge viewports in a 300px iframe just because its parent viewport is huge.

Regarding the security issues, CORS could be one solution, but not a great one as few websites enable it. What about not being able to read the computed height if the iframe is cross-origin? Similarly to how one can't read the computed style applied with :visited.

~Lea

[1]: https://twitter.com/leaverou/status/690583334414635009 <https://twitter.com/leaverou/status/690583334414635009>

Received on Monday, 22 February 2016 08:35:45 UTC