Implement special table sizing for floats (#32150)

Tables should always be at least as big as their min-content size, even
if we would expect a smaller size according to CSS sizing properties.

#31455 implemented it for in-flow tables participting in flow layout,
but a few cases remained. This patch addresses floated tables.
This commit is contained in:
Oriol Brufau 2024-04-26 16:42:20 +02:00 committed by GitHub
parent 18a4c7503a
commit a14ee03de3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 6 deletions

View file

@ -950,12 +950,26 @@ impl FloatBox {
&containing_block_for_children,
containing_block,
);
let (block_size, inline_size) =
match independent_layout.content_inline_size_for_table {
Some(inline_size) => (
independent_layout.content_block_size.into(),
inline_size.into(),
),
None => (
box_size.block.auto_is(|| {
Length::from(independent_layout.content_block_size)
.clamp_between_extremums(
min_box_size.block,
max_box_size.block,
)
}),
inline_size,
),
};
content_size = LogicalVec2 {
inline: inline_size,
block: block_size.auto_is(|| {
Length::from(independent_layout.content_block_size)
.clamp_between_extremums(min_box_size.block, max_box_size.block)
}),
block: block_size,
};
children = independent_layout.fragments;
},