Re: [csswg-drafts] [css-sizing-4] Should aspect-ratio apply for width: auto; height: auto;? (#5060)

I would expect all sizing for elements with a fixed `aspect-ratio` to behave the same as for a replaced element with a fixed aspect ratio.

For a block element in flow layout, that means that yes, the block size would be maximized to fit (after adjusting for padding/border, same as normal), and then the aspect ratio would determine the height.  In other layout situations, different calculations would apply, but I *think* we now have defined algorithms for all these cases, including the flexbox one (if I recall correctly: it stretches to fit the row height, then the width gets calculated from the aspect ratio & becomes the flex-basis, but then flex grow or shrink applies and can distort the aspect ratio from its ideal).

The main difference between a CSS box with aspect ratio, versus an image or SVG with an aspect ratio, would be in how min-content and max-content sizes are calculated, based on the normal rules for text/child CSS content instead of based on the intrinsic sizes of the replaced content.

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

Received on Monday, 11 May 2020 23:33:07 UTC