W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2021

Re: [csswg-drafts] [css-sizing-4] Expected size of replaced element with aspect-ratio but width/height auto (#5721)

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Wed, 20 Jan 2021 17:44:47 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-763819070-1611164685-sysbot+gh@w3.org>
> It's not quite clear. I think it probably needs to say

Ah yeah, that clarification makes sense.

> So to clarify, since there is no explicit size here by definition, we will always compute the block size from the inline size?


1. No explicit sizes means it uses the automatic sizes of the element.
2. For replaced elements the automatic sizes are the natural sizes.
3. When 'aspect-ratio' is in play the automatic size in the ratio-dependent axis is instead calculated from the size in the ratio-determining axis + aspect-ratio
4. Since both 'width' and 'height' are using automatic sizes, the ratio-dependent axis is the block axis by default.

So the image in the original post will use its natural width, and then its height will be the same as its width, to make it square.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 20 January 2021 17:44:48 UTC

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