[csswg-drafts] [css-sizing] Effect of 'aspect-ratio' on 'min-size: auto' properties should probably be axis-specific (#5268)

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

== [css-sizing] Effect of 'aspect-ratio' on 'min-size: auto' properties should probably be axis-specific ==
Given this example (from [here](https://github.com/w3c/csswg-drafts/issues/5032#issuecomment-644517090)):

```html
<div style="height: 100px; aspect-ratio: 1 / 1; width: max-content;">
  <div style="display: inline-block; width: 150px;"></div>
  <div style="display: inline-block; width: 150px;"></div>
</div>
```

'height' is specified. 'width' is also specified, but per [our guidelines](https://github.com/w3c/csswg-drafts/issues/5032#issuecomment-639874263), it resolves to the upper bound of the fit-content algo, which means it pays attention to the aspect ratio, and resolves to '100px'.

The implicit 'min-width: auto', tho, needs to resolve based on the "min-intrinsic size" (again, per notes, not yet per spec), so that it can override a-r when needed to prevent overflow. This means it would resolve to '150px', leading to a 150x100 box.

This probably isn't what authors expect! Protecting against overflow in the block axis seems useful, as it will be common and hard to defend against, but overflow in the inline axis is generally rare, and often intentional when it occurs.

It's not completely clear what behavior an author would expect from that code, but it seems likely that 150px width, breaking the aspect ratio, isn't it. We could fix this by defaulting "auto" to "min-content" in the inline axis and "min-intrinsic" in the block axis.

(Remember that, in the absence of aspect-ratio, the two terms have identical behavior.)

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

Received on Monday, 29 June 2020 20:59:06 UTC