From 52cddb45bdba037b6016e7183ee68036bc36fbe5 Mon Sep 17 00:00:00 2001 From: Adavize Promise <128262752+cashall-0@users.noreply.github.com> Date: Thu, 10 Oct 2024 12:13:48 +0100 Subject: [PATCH] Use `content_box_sizes_and_padding_border_margin_deprecated()` in `FlexItem::new()` (#33754) * Use content_box_sizes_and_padding_border_margin_deprecated() in FlexItem::new() Signed-off-by: PS Adavize * remove unnecessary variable declaration declaration Signed-off-by: PS Adavize * Remove redundant variable pbm Signed-off-by: PS Adavize --------- Signed-off-by: PS Adavize --- components/layout_2020/flexbox/layout.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/components/layout_2020/flexbox/layout.rs b/components/layout_2020/flexbox/layout.rs index fa22604f463..ef4793e4a4a 100644 --- a/components/layout_2020/flexbox/layout.rs +++ b/components/layout_2020/flexbox/layout.rs @@ -1023,19 +1023,9 @@ impl<'a> FlexItem<'a> { flex_context.config.flex_axis, ); - let pbm = box_.style().padding_border_margin(containing_block); - let content_box_size = box_ + let (content_box_size, min_size, max_size, pbm) = box_ .style() - .content_box_size_deprecated(containing_block, &pbm) - .map(|v| v.map(Au::from)); - let max_size = box_ - .style() - .content_max_box_size_deprecated(containing_block, &pbm) - .map(|v| v.map(Au::from)); - let min_size = box_ - .style() - .content_min_box_size_deprecated(containing_block, &pbm) - .map(|v| v.map(Au::from)); + .content_box_sizes_and_padding_border_margin_deprecated(&containing_block.into()); let margin_auto_is_zero = flex_context.sides_to_flex_relative(pbm.margin.auto_is(Au::zero)); let padding = flex_context.sides_to_flex_relative(pbm.padding);