After the recent removal of the `@seamless` attribute on the `<iframe>` from the WHATWG spec: https://github.com/whatwg/html/issues/331 We still need to consider the problem of setting the height of iframes, so they contain their content without scroll bars. As discussed at: https://github.com/whatwg/html/issues/555 https://lists.w3.org/Archives/Public/www-style/2016Jan/0236.html https://lists.w3.org/Archives/Public/www-style/2016Feb/0004.html The solution may simply involve the CSS: #iframe { height: max-content; } And a header on the framed content, rather than custom/buggy JavaScript. ----- I'm keeping my notes on: https://github.com/craigfrancis/iframe-height
Alternatively we could look at a new keyword for the resize[1] property, which would be useful for a <textarea> that automatically increases its height based on its content - another problem which requires JavaScript to solve. [1] https://developer.mozilla.org/en-US/docs/Web/CSS/resize
*** Bug 186275 has been marked as a duplicate of this bug. ***
The CSS Working Group resolved on a two-sided solution, an HTML mechanism to express the intrinsic size of the iframe and a 'from-element' keyword for the 'contain-intrinsic-size' property. See https://github.com/w3c/csswg-drafts/issues/1771#issuecomment-989034819. Sebastian