Re: [csswg-drafts] [css-sizing-4][css-flexbox] How to calculate the content-based minimum sizes when applying aspect-ratio on the flex container (#5406)

@BorisChiou: 
> Do we just use the outer hypothetical main size of each flex item to calculate the main size, and compare this with the main size of the flex container from aspect-ratio (i.e. flexContainerMainSize = std::max(mainSizeFromContent, mainSizeFromAspectRatio))?

For single-line flex containers, yeah, I think that's a reasonable approximation of what the spec asks for.

Strictly speaking: to determine the min-content size here, we should be following https://drafts.csswg.org/css-flexbox-1/#intrinsic-main-sizes (which is effectively trying to reverse-engineer the flex algorithm to produce the flex container size that would avoid overflow), I think.

For multi-line flex containers, though, there's a special-case at the bottom of that section:
```
  However, for a multi-line container, it [the min-content main-size]
  is simply the largest min-content contribution of all the flex items
  in the flex container.
```
where `min-content contribution` is defined at https://drafts.csswg.org/css-flexbox-1/#intrinsic-item-contributions .

That special-case means biesi's assessment here is wrong, and we should technically wrap in this testcase. (Its flex container's min-content height [the lower-bound that aspect-ratio can shrink it to here] is 50px, which comes from the individual items, rather than coming from the sum of the items' heights.

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


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

Received on Tuesday, 8 September 2020 20:59:29 UTC