w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.5k stars 661 forks source link

[css-sizing] Should `aspect-ratio: <ratio>` obey `box-sizing` on replaced elements with auto preferred sizes? #11093

Open Loirooriol opened 2 weeks ago

Loirooriol commented 2 weeks ago

So my understanding from #4951 and https://drafts.csswg.org/css-sizing-4/#valdef-aspect-ratio-ratio is that these tests are wrong:

Since aspect-ratio doesn't have auto, then it should obey box-sizing.

But of course the tests are part of interop-2021 and all browsers are passing them.

I'm not sure if there has been some amendment to align with browsers.

Loirooriol commented 1 week ago

So to be specific, https://drafts.csswg.org/css-sizing-4/#valdef-aspect-ratio-ratio says

The tests have the default min-width: auto that behaves as 0, which is floored to 80px to avoid a negative content width, then this is transferred to a min border-box height of 80px / (20/50) = 200px. But the tests expects 100px instead.

Browsers are passing the tests for different reasons:

Agenda+ to ratify the spec or align with some browser.