W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2020

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

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Thu, 01 Oct 2020 20:27:58 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-702378782-1601584077-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:20 UTC