Re: [csswg-drafts] [css-flexbox] Percentage height resolution of children of flex items with indefinite flex basis (#6822)

I feel the spirit of CSS2 still applies here because flexbox's main size property (`height` in the testcase) has no control over things. A flex item's main size is controlled by the `flex-basis`. Here is the quote from [main size property](https://drafts.csswg.org/css-flexbox-1/#main-size-property).

> In flex layout, the main size is controlled by the flex property rather than directly by the main size property.

Also, `flex-basis:content; height:100px` is equivalent to `height: max-content;` per the definition of [`flex-basis:content`](https://drafts.csswg.org/css-flexbox-1/#valdef-flex-basis-content).

Re Option 2 (WebKit) in the first comment:

> It's unclear to me that we could consider that the height of the containing block depends on the content height for the purpouse of resolving the percentage. It does indeed depend on the content height to compute the flex basis, but I don't think we could conclude that after computing the flex basis we should still consider the size as indefinite.

`flex-basis` determines the main size after [flex algo 9.2.3](https://drafts.csswg.org/css-flexbox-1/#algo-main-item). I don't feel it is reasonable to resolve the flex item's percentage height child **again** after the item's main size becomes definite, because it is just a cyclic percentage.

Similarly, we don't want to resolve the inner `height:100%` after the outer block's height becomes definite, do we?

```
  <div style="display: block; height: max-content;">
    <div style="height: 30px; width: 100px; background: blue;"></div>
    <div style="height: 100%; width: 100px; background: red;"></div>
  </div>
```



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


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

Received on Friday, 24 December 2021 02:28:37 UTC