diff options
author | Oriol Brufau <obrufau@igalia.com> | 2024-08-29 18:55:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-29 16:55:44 +0000 |
commit | 4bf941bc8a0eff281da668dbe550fb52c0e7a983 (patch) | |
tree | e5e7d5d4d1e42a661345ad80578ba1aea6d275ff /components/layout_2020/flexbox/layout.rs | |
parent | 9ea02fa4b46e92c00d3efa252e36681729d385a0 (diff) | |
download | servo-4bf941bc8a0eff281da668dbe550fb52c0e7a983.tar.gz servo-4bf941bc8a0eff281da668dbe550fb52c0e7a983.zip |
Fix automatic minimum size for column flexbox (#33248)
`main_content_size_info()` was always assigning the main-axis automatic
minimum size into the inline axis. But in a column flexbox, the main
axis corresponds to the block axis.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'components/layout_2020/flexbox/layout.rs')
-rw-r--r-- | components/layout_2020/flexbox/layout.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/components/layout_2020/flexbox/layout.rs b/components/layout_2020/flexbox/layout.rs index d91ced838fb..b7dd80d31ae 100644 --- a/components/layout_2020/flexbox/layout.rs +++ b/components/layout_2020/flexbox/layout.rs @@ -1932,9 +1932,16 @@ impl FlexItemBox { ) }, ); - let content_min_size_no_auto = LogicalVec2 { - inline: content_min_size.inline.auto_is(|| automatic_min_size), - block: content_min_size.block.auto_is(Au::zero), + let content_min_size_no_auto = if cross_axis_is_item_block_axis { + LogicalVec2 { + inline: content_min_size.inline.auto_is(|| automatic_min_size), + block: content_min_size.block.auto_is(Au::zero), + } + } else { + LogicalVec2 { + inline: content_min_size.inline.auto_is(Au::zero), + block: content_min_size.block.auto_is(|| automatic_min_size), + } }; let block_content_size_callback = |item: &mut FlexItemBox| { item.layout_for_block_content_size( |