Skip to content

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

Closed
@SimonSapin

Description

@SimonSapin

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 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?)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions