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

I like the suggestion, and I'm fine with the iframed page having to use JS. My focus is on making it as safe and easy for the parent page to include 3rd party content (e.g. no 3rd party `<script>` getting access to the rest of the page/site, also helping with site-isolation; or the site itself having their own JS to handle a non-standard `postMessage()`).

The bit I'm not completely sure on is sizing. I like how you've thought about providing a default size while the content is loading (like how an `<img>` can now use width/height attributes for the `aspect-ratio`). But I wonder if there's a simpler way (without using JS) for the parent to apply limits to the size of the iframe?

Most cases I can think of will only want the height to change (the parent pages design tends to define the width). So maybe the CSS `(min-|max-)?(width|height)` might be relevant here?

For example, `width: 100%` or `width: 30em` could be used by the parent page to fix the width?

Also, do you consider the use of `contain-intrinsic-size: from-element X Y` to be required, considering `allow=resize` is granting permission to change the size? or is it just providing the default size?

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


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

Received on Wednesday, 24 March 2021 11:18:47 UTC