[csswg-drafts] [css-images-4] Should `contain-intrinsic-size` affect `object-fit`? (#10116)

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

== [css-images-4] Should `contain-intrinsic-size` affect `object-fit`? ==
[This question came up during `sizes=auto` spec/implementation work](https://github.com/whatwg/html/issues/10079), and I don't know the answer.

Here's a test page: https://codepen.io/eeeps/pen/mdgWNJo?editors=1101

[WebKit thinks that it should](https://o.img.rodeo/image/upload/v1711052026/kspptzsafh9kex0rtnf7.png), [Chromium thinks that it should](https://o.img.rodeo/image/upload/v1711052050/eyr42shpztgsxccigtr1.png), and [Firefox refuses to do any kind of object-fitting on size-contained elements](https://o.img.rodeo/image/upload/v1711052061/zfnvwrz2watd9exuah6i.png).

Notably, @mirisuzanne [thinks that it shouldn't,](https://github.com/whatwg/html/issues/10079#issuecomment-2010705829) because `contain-intrinsic-size` doesn't actually change the natural dimensions of replaced elements (`Image.naturalWidth`/`naturalHeight` are unaffected), but simply tells the layout algorithm to proceed *as if those were the natural dimensions*.

I agree with her, and think UAs should use the actual natural dimensions that you get from `Image.naturalWidth`/`naturalHeight`, and not the `contain-intrinsic-size` dimensions, when painting `object-fit` objects into `contain:size`d elements. I think we need some more spec language somewhere here, although admittedly my understanding of the precise meaning of [concrete object size](https://www.w3.org/TR/css-images-3/#concrete-object-size) is provisional at best.

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


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

Received on Thursday, 21 March 2024 20:21:58 UTC