[csswg-drafts] [css-sizing] Intrinsic size of <img> / <video> with aspect ratio but no definite size (#10605)

emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-sizing] Intrinsic size of <img> / <video> with aspect ratio but no definite size ==
Consider [this test-case](https://bug1905511.bmoattachments.org/attachment.cgi?id=9413986) from [Mozilla bug 1905511](https://bugzilla.mozilla.org/show_bug.cgi?id=1905511).

In it, you can see how, while loading an image, Firefox treats it as having no intrinsic size (like the SVG). This is consistent with how we want to treat videos (for the use-case in https://github.com/w3c/csswg-drafts/issues/7524 to work, which works now in Firefox and WebKit).

However that's not what Blink does, and people get a bit confused (because the image might grow too much). It seems WebKit does something weird where it doesn't stretch images with no intrinsic size but a ratio (like the SVG in the test-case).

Blink seems to just give the image a 0x0 size while loading, which is slightly unfortunate, but maybe fine. I could live with that inconsistency between `<img>` and `<video>` I guess. The issue with `<video>` is really the default object size.

Questions:

 * What of the two `<img>` behaviors do we want? Both seem acceptable to me, but let's be interoperable? :)
   * `<img>` has `0x0` intrinsic size (doesn't respect aspect-ratio if no dimension is definite, Blink's behavior)
   * `<img>` has no intrinsic size (might grow too much, Firefox's behavior).
 * Is there some interest in Blink for fixing the `<video>` situation in #7524? ([test here](https://wpt.fyi/results/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html)). Chromium filed it so I was hoping they'd get to it sooner rather than later.
 * (Bonus) What is WebKit doing?

Want to run it through the group before going with Blink's behavior, in case people have strong opinions...

cc: @fantasai @jensimmons @bfgeek @chrishtr

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10605 using your GitHub account


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

Received on Sunday, 21 July 2024 01:54:24 UTC