Fix intrinsic sizing of column flex containers (#33299)

From https://drafts.csswg.org/css-flexbox-1/#intrinsic-cross-sizes,
> The min-content/max-content cross size of a single-line flex container
> is the largest min-content contribution/max-content contribution
> (respectively) of its flex items.

We were using the min/max-content size instead of the min/max-content
contribution.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2024-09-04 08:44:31 +02:00 committed by GitHub
parent e43e477842
commit 27d87f104e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 3 additions and 63 deletions

View file

@ -361,13 +361,11 @@ impl FlexContainer {
// columns, and sum the column sizes and gaps.
// TODO: Use the proper automatic minimum size.
let ifc = &mut item.independent_formatting_context;
content_sizes.max_assign(ifc.inline_content_sizes(
content_sizes.max_assign(ifc.outer_inline_content_sizes(
layout_context,
&containing_block_for_children.new_for_intrinsic_inline_size_of_child(
&ifc.style().clone(),
&LogicalVec2::zero(),
),
containing_block_for_children,
&LogicalVec2::zero(),
false, /* auto_block_size_stretches_to_containing_block */
));
},
FlexLevelBox::OutOfFlowAbsolutelyPositionedBox(_) => {},