diff options
author | Oriol Brufau <obrufau@igalia.com> | 2024-08-31 01:39:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-30 23:39:18 +0000 |
commit | 3acc9edd82ce159a356bd88a26fd37b2b39d6a44 (patch) | |
tree | a1465b2ab25e65fc59061817faa08550d0828ec0 /components/layout_2020/flow/mod.rs | |
parent | 4ae2610c24bfbd7acabf7ff327cf97d6df55c06f (diff) | |
download | servo-3acc9edd82ce159a356bd88a26fd37b2b39d6a44.tar.gz servo-3acc9edd82ce159a356bd88a26fd37b2b39d6a44.zip |
Fix various issues with replaced elements in flex layout (#33263)
In particular, this takes into account that flex items may be stretched,
and if they have an aspect ratio, we ma6y need to convert the stretched
size through the ratio.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/layout_2020/flow/mod.rs')
-rw-r--r-- | components/layout_2020/flow/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index 0d5d233eeb0..3f3f7334182 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -372,6 +372,7 @@ fn calculate_inline_content_size_for_block_level_boxes( layout_context, containing_block, &LogicalVec2::zero(), + false, /* auto_block_size_stretches_to_containing_block */ ) .max(ContentSizes::zero()); let style_box = &float_box.contents.style().get_box(); @@ -384,6 +385,7 @@ fn calculate_inline_content_size_for_block_level_boxes( style, &containing_block, &LogicalVec2::zero(), + false, /* auto_block_size_stretches_to_containing_block */ |containing_block_for_children| { contents.inline_content_sizes(layout_context, containing_block_for_children) }, @@ -400,6 +402,7 @@ fn calculate_inline_content_size_for_block_level_boxes( layout_context, containing_block, &LogicalVec2::zero(), + false, /* auto_block_size_stretches_to_containing_block */ ) .max(ContentSizes::zero()); Some((size, Float::None, independent.style().get_box().clear)) @@ -1296,7 +1299,7 @@ fn layout_in_flow_replaced_block_level( mut sequential_layout_state: Option<&mut SequentialLayoutState>, ) -> BoxFragment { let pbm = style.padding_border_margin(containing_block); - let content_size = replaced.used_size_as_if_inline_element(containing_block, style, None, &pbm); + let content_size = replaced.used_size_as_if_inline_element(containing_block, style, &pbm); let margin_inline_start; let margin_inline_end; |