Re: [csswg-drafts] [css2] Clarify 10.6.2: height with auto sizing, intrinsic ratio, and intrinsic height (#12254)

> The width is undefined in CSS2, but browsers will decide on some width. 

The spec doesn’t seem definitive here. [10.3.2](https://drafts.csswg.org/css2/#inline-replaced-width)  presents the behavior as a suggestion, not a requirement:

> "However, it is suggested that, if the containing block’s  ..."

Regarding the final clause in 10.3.2:

>Otherwise, if [width](https://drafts.csswg.org/css2/#propdef-width) has a computed value of [auto](https://drafts.csswg.org/css2/#valdef-width-auto), but none of the conditions above are met, then the used value of width becomes 300px. If 300px is too wide to fit the device, UAs should use the width of the largest rectangle that has a 2:1 ratio and fits the device instead.

It's not clear to me whether the case described earlier:

>If [height](https://drafts.csswg.org/css2/#propdef-height) and [width](https://drafts.csswg.org/css2/#propdef-width) both have computed values of auto and the element has an intrinsic ratio but no intrinsic height or width,

is actually intended to fall under this fallback clause, or if it is treated separately. It's also unclear how to reliably test this behavior in practice.

In particular, neither Chrome nor Firefox appear to follow this fallback behavior when rendering the following code:

```html
<!DOCTYPE html>
<div>
  <img src="" alt="test" style="background-color: blue; aspect-ratio: 1 / 1;">Test</span>
</div>
```






-- 
GitHub Notification of comment by gitspeaks
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12254#issuecomment-2929941985 using your GitHub account


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

Received on Monday, 2 June 2025 10:33:13 UTC