I’m making the suggestion here as well, as requested by Alan Cutter.
After the recent removal of the @seamless attribute on the
<iframe> from the WHATWG spec (issue 331); we still need to consider the problem of setting the height of iframes, so they contain their content without scroll bars.
The full justification is at:
The discussion started on the W3C WWW-Style mailing list:
But this pretty much died out last month when Ojan Vafai insisted that the ResizeObserver was a solution to this problem (I don’t think it is):
So ignoring the Chrome developers, we have Simon Fraser from Safari, and Robert O’Callahan from Firefox, who say that this is possible to implement (Safari having already done this for their “frame flattening” feature).
I have written up some notes about the infinite loops problem, which should be rare if we only allow the the height to change. And if it really does become an issue, we can cheat, and let the browser do an initial layout, and if it determines a second pass is necessary, then lock the height, and use scroll bars as we do today.
And as an aside, if
height: max-content was implemented on iframes, this would also be useful for texareas:
Feature request: Auto-resize textarea
And with height animation:
Feature request: Animating max-height / height based on content