Re: [csswg-drafts] [css-sizing-4][css-contain] Clarify on specifying aspect-ratio and contain:size on replaced elements (#5550)

Yes, `contain:size` censors the intrinsic aspect ratio, but an explicit 'aspect-ratio' value will still give the element an aspect ratio. So the element in the OP's example should be 100x100.

There's a related question of how the `width`/`height` attributes on an `img` are interpreted; I think the most reasonable and consistent answer is that their ratio is mapped to 'aspect-ratio' as a presentational hint (same as `width`/`height` are mapped to 'width'/'height', and so it's respected even when `contain:size` is specified.

This isn't correct per-spec right now, but <https://github.com/whatwg/html/issues/5907> has been filed to fix this.

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


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

Received on Thursday, 1 October 2020 20:28:00 UTC