Re: [csswg-drafts] [css-sizing] Auto-resize iframes based on content (#1771)

> <bramus> fantasai: does svg have different people between iframe and ??
> <bramus> dbholbert: it does
> <smfr> s/??/object/
> <bramus> s/people/behavior
> <bramus> iank_: thank you for the discussion, and we’ll file some follow-up issues
> <dholbert> specifically if you put an SVG with large height/width/viewBox into an iframe, then we put the iframe at the default object size and we let the SVG overflow and have large scrollWidth and scrollHeight


Here's a live-dom-viewer link for the testcase I was looking at, where the svg internal document gets a large scrollHeight in an iframe vs. exactly fits the viewport in object and embed:
https://www.software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cscript%3E%0A%20%20function%20go()%20%7B%0A%20%20%20%20let%20dataURI%20%3D%20%27data%3Aimage%2Fsvg%2Bxml%2C%3Csvg%20height%3D%221000%22%20width%3D%221000%22%20viewBox%3D%220%200%201000%201000%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20height%3D%22960%22%20width%3D%22960%22%20stroke-width%3D%2240%22%20stroke%3D%22black%22%20fill%3D%22cyan%22%2F%3E%3C%2Fsvg%3E%27%3B%0A%20%20%20%20myIframe.setAttribute(%22src%22%2C%20dataURI)%3B%0A%20%20%20%20myEmbed.setAttribute(%22src%22%2C%20dataURI)%3B%0A%20%20%20%20myObject.setAttribute(%22data%22%2C%20dataURI)%3B%0A%20%20%7D%0A%3C%2Fscript%3E%0A%3Cstyle%3E%0A%20%20iframe%2C%20object%2C%20embed%20%7B%20width%3A%20100px%3B%20border%3A%201px%20solid%20black%20%7D%0A%3C%2Fstyle%3E%0A%3Cbody%20onload%3D%22go()%22%3E%0A%3Ciframe%20id%3D%22myIframe%22%3E%3C%2Fiframe%3E%3Cbr%3E%0A%3Cobject%20id%3D%22myObject%22%3E%3C%2Fobject%3E%3Cbr%3E%0A%3Cembed%20id%3D%22myEmbed%22%3E%3C%2Fembed%3E%0A

-- 
GitHub Notification of comment by dholbert
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1771#issuecomment-3807569635 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 27 January 2026 21:15:07 UTC