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

In AmeliaBR's [testcase with two SVG elements](https://plexode.com/eval3/#s=aekVQXANJVQMbAx1yAXgePQN5GwFHTUZZHAGDnRIREVGiAVBWVU1KT0adhwFTRkWjgp0TE6mimh89TwEBHVGXmQOEnVFWU1GgAYxVVbjBNUZUVbFIHRBRwsTGlpiaQlRRRkRVDlNC3FCmEBKji51It0ZPo6UBU4RAwTCwcYLfOTiYqVZLndLrdrveLzeoBe4BLRGJpNKBYgoDD8HhLGKhXJABK5KIxYEZQLLKBwSAMwAITmiahgDixDJpWIz9UyogUEYLDYsKIhKKZEaRTZQSm5HJUaZRRWJMTQQkTfkhIrVck8plctl8xmc1Cc3c05TpQd5PJE+ojjY1IpVMp1QqRNZRFIRTJgza4DrNFYwQrjikIDLwAA==) that she [posted about above](https://github.com/w3c/csswg-drafts/issues/5060#issuecomment-628944357), I believe what's actually happening in Firefox is:
* the first SVG element has a resolved `flex-basis` of `100px` (from its specified `height:100%` height (cross-size) resolving against the container height, and transferring through the aspect ratio to produce a definite main-size)
* the second SVG element has a resolved `flex-basis` of `220px` (which I think comes from resolving its implicit `width=100%` attribute against the size of its container...?)  It shrinks to something smaller, but if you use Firefox flex devtools or add `flex-shrink:0`, then you can see (in Firefox at least) that its flex-basis is 220px.  (This might be a Firefox bug, not sure.)  It seems like Chrome instead is treating its flex-basis as 0px here, I guess?
* This is true for the SVG elements in the testcase-variant in [biesi's response](https://github.com/w3c/csswg-drafts/issues/5060#issuecomment-628945499), too.

Here's a [variant of Amelia's testcase](https://plexode.com/eval3/#s=aekVQXANJVQMbAx1yAXgePQN5GwFHTUZZHAGDnRIREVGiAVBWVU1KT0adhwFTRkWjgp0TE6mreg5URk1HnZ+hwlVCU1Ucmh89TwEBHVGXmQOEnVFWU1GgAYxVVbjQNUZUVbFIHRBR0dPVlpiaQlRRRkRVDlNCdZQUwQCSjRadJC3IxPUalAKnCIGCYWZ4DD7uOTxaiVbD2fD6fj+gECggBgwBLTEJpQLEUiwQjDSjRUK5IAJXJRGLAjKBZbIOCQBn4BCdDTUcAcmIZNKxGhimVERiaeUBZYRJKaxJgbCLQmLUapEJRTIjhKbZCVGI5KJpNbJRrKaCEZaoQmZIuYdu02nE6nk+oFCogToz1pCdKD+J5IprIqpUq9ZrddeVgsVkIy2s9ptdtTRFZhMGbmAdyrzuuzxi4fAZeAA=) with `flex-shrink:0` added, to demonstrate this.

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

Received on Monday, 18 May 2020 17:04:40 UTC