diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-04-12 10:52:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-12 08:52:30 +0000 |
commit | a4a308e4342b3717a20c599b98d10ab27fe75065 (patch) | |
tree | 0f1743387e6b7cfaafcce40a7559fcb5db9ab373 /components/layout_2020/flexbox/layout.rs | |
parent | 3c4ec171801c93eccf209f08fc01f201d57f73e7 (diff) | |
download | servo-a4a308e4342b3717a20c599b98d10ab27fe75065.tar.gz servo-a4a308e4342b3717a20c599b98d10ab27fe75065.zip |
layout: Box `block_margins_collapsed_with_children` member of `BoxFragment` (#36474)
This reduces the size of `BoxFragment` by around 20 bytes.
Testing: This just changes the layout of a data structure, so is
covered by existing WPT tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'components/layout_2020/flexbox/layout.rs')
-rw-r--r-- | components/layout_2020/flexbox/layout.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/components/layout_2020/flexbox/layout.rs b/components/layout_2020/flexbox/layout.rs index 55fa5a173b0..c43ab84fc54 100644 --- a/components/layout_2020/flexbox/layout.rs +++ b/components/layout_2020/flexbox/layout.rs @@ -256,8 +256,6 @@ impl FlexLineItem<'_> { size: item_used_size, }, ); - let margin = flex_context.sides_to_flow_relative(item_margin); - let collapsed_margin = CollapsedBlockMargins::from_margin(&margin); if let Some(item_baseline) = self.layout_result.baseline_relative_to_margin_box.as_ref() { let item_baseline = *item_baseline + item_content_cross_start_position - @@ -294,9 +292,10 @@ impl FlexLineItem<'_> { flex_context .sides_to_flow_relative(self.item.border) .to_physical(container_writing_mode), - margin.to_physical(container_writing_mode), + flex_context + .sides_to_flow_relative(item_margin) + .to_physical(container_writing_mode), None, /* clearance */ - collapsed_margin, ); // If this flex item establishes a containing block for absolutely-positioned |