[csswg-drafts] [css-flexbox] Conflicting definitions of used cross size of a flex container (#5190)

SimonSapin has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-flexbox] Conflicting definitions of used cross size of a flex container ==
https://drafts.csswg.org/css-flexbox/#algo-cross-container specifies the used cross size of a flex container, based on that of flex lines and therefore of flex items. However the container itself participates in an "outer" formatting context that typically also specifies a used size, with a different algorithm.

For example, for a block-level horizontal column flex container, the cross size is the width and https://drafts.csswg.org/css2/visudet.html#blockwidth applies.

For comparison, tables in CSS 2 have normative text specifically about resolving this conflict: https://drafts.csswg.org/css2/tables.html#width-layout
> Note that this section overrides the rules that apply to calculating widths as described in section 10.3. In particular, if the margins of a table are set to '0' and the width to 'auto', the table will not automatically size to fill its containing block. However, once the calculated value of 'width' for the table is found (using the algorithms given below or, when appropriate, some other UA dependent algorithm) then the other parts of section 10.3 do apply.

I didn’t find anything similar in css-flexbox. Should it be added?

More generally, for elements that establish an [independent formatting context](https://drafts.csswg.org/css-display-3/#independent-formatting-context) it would be nice to have a common "protocol" for how the inner and outer layout modes interact with each other, in order to support arbitrary combination and not need separate definitions for each pair. (What happens for a grid item table? A table cell flex container?)

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5190 using your GitHub account

Received on Wednesday, 10 June 2020 13:25:16 UTC