Bug 153952 - Feature request: Auto-resize iframes based on content
Summary: Feature request: Auto-resize iframes based on content
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 186275 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-02-06 11:20 PST by Craig Francis
Modified: 2023-05-02 13:01 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Francis 2016-02-06 11:20:59 PST
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
Comment 1 Craig Francis 2016-02-06 11:21:13 PST
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
Comment 2 Simon Fraser (smfr) 2018-06-05 07:48:38 PDT
*** Bug 186275 has been marked as a duplicate of this bug. ***
Comment 3 Sebastian Zartner 2023-05-02 13:01:16 PDT
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