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

The CSS Working Group just discussed ``[css-images-4] Should `contain-intrinsic-size` affect `object-fit`?``, and agreed to the following:

* ``RESOLVED: `contain` removes the natural aspect ratio / width / height only for the purposes of sizing and layout of the box (and object-fit is therefore not affected)``

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins1> argh, be there one sec<br>
&lt;fantasai> EricP: object-fit uses the natural size, but there are two natural aspect ratios we care about<br>
&lt;fantasai> EricP: there's the actual natural aspect ratio of the object, and the one we use in layout (affected by contain-intrinsic-size)<br>
&lt;fantasai> EricP: wanted to do auto sizes for ? and were using contain-intrinsic-size<br>
&lt;fantasai> EricP: If you don't do that, you will load every resource in srcset, very bad<br>
&lt;fantasai> EricP: When shipped in Chrome Beta, a number of sites were also using sizes=auto and those images became distorted<br>
&lt;fantasai> EricP: We thought maybe set contain-intrinsic-size in UA stylesheet<br>
&lt;fantasai> EricP: But realized maybe we need two concepts, the intrinsic size for layout vs the intrinsic size for drawing<br>
&lt;vmpstr> q+<br>
&lt;miriam> q+<br>
&lt;TabAtkins> +1 to being explicit in both sites<br>
&lt;astearns> ack vmpstr<br>
&lt;fantasai> EricP: object-fit is looking at the actual intrinsic size, contain is for layout only<br>
&lt;fantasai> vmpstr: Is object-fit the only property that should be affected by actual natural size?<br>
&lt;fantasai> miriam: I'm thinking in the reverse way, the containment features should only remove the natural sizing for layout purposes<br>
&lt;schenney> q+<br>
&lt;fantasai> miriam: the answer is, anything not about laying out the box should respect the natural size<br>
&lt;fantasai> +1<br>
&lt;florian> +1 to miriam<br>
&lt;astearns> ack miriam<br>
&lt;schenney> q-<br>
&lt;fantasai> miriam: This also solves some other problems we've had in the past, where no way to remove the aspect ratio of the image and give it a new one<br>
&lt;fantasai> -> https://www.w3.org/TR/css-sizing-4/#aspect-ratio<br>
&lt;fantasai> miriam: hard to have the image contribute some dimensions without contributing its aspect ratio or nothing<br>
&lt;fantasai> miriam: we discussed awhile back, and ian made a proposal similar here, basically that containment should only contain for purposes of layout, nothing else<br>
&lt;astearns> ack fantasai<br>
&lt;dholbert> scribe+ dandclark<br>
&lt;dandclark> fantasai: When we the aspect ratio prop we added the concept of preferred aspect ratio, which is different from natural aspect ratio. Can we hook into that concept? Agree contain shouldn't hook into natural aspect ratio.<br>
&lt;eeeps> q+<br>
&lt;astearns> ack eeeps<br>
&lt;dandclark> eeeps: I do think we need aspect ratio, and width, and height. Ratio alone isn't enough for modes like object fit scale down<br>
&lt;fantasai> astearns: so can we update the proposed resolution to use natural vs preferred aspect ratio terms?<br>
&lt;dandclark> fantasai: Let's specify what we're trying to get here, and Tab and I can deal with the vocab aspects of it. We're trying to say that contain removes natural aspect ratio for purposes of [missed]. Tab and I can figure out what that means in specs.<br>
&lt;fantasai> s/[missed]/sizing/<br>
&lt;fantasai> PROPOSED: `contain` removes the natural aspect ratio / width / height only for the purposes of sizing and layout<br>
&lt;fantasai> dholbert: maybe clarify that it doesn't impact how object-fit works<br>
&lt;dandclark> fantasai: For sizing and layout of the box, and i.e. object fit is not affected<br>
&lt;fantasai> PROPOSED: `contain` removes the natural aspect ratio / width / height only for the purposes of sizing and layout of the box (and object-fit is therefore not affected)<br>
&lt;fantasai> astearns: Sounds like we're in agreement, might need some wordsmithing to put in the specs<br>
&lt;fantasai> astearns: any objections?<br>
&lt;fantasai> RESOLVED: `contain` removes the natural aspect ratio / width / height only for the purposes of sizing and layout of the box (and object-fit is therefore not affected)<br>
&lt;fantasai> astearns: Any other notes for the minutes?<br>
&lt;fantasai> miriam: notes in the linked issues<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10116#issuecomment-2035803916 using your GitHub account


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

Received on Wednesday, 3 April 2024 23:29:02 UTC