Description
This question came up during sizes=auto
spec/implementation work.
Here's a test page: https://codepen.io/eeeps/pen/mdgWNJo?editors=1101
WebKit thinks that it should, Chromium thinks that it should, and Firefox refuses to do any kind of object-fitting on size-contained elements.
Notably, @mirisuzanne thinks that it shouldn't, 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 some of the concepts here is provisional at best.