De-indent code in find_block_margin_collapsing_with_parent (#29997)

This commit is contained in:
Oriol Brufau 2023-07-13 18:27:21 +02:00 committed by GitHub
parent 4bf2bca167
commit befc0f5a5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,8 +83,11 @@ impl BlockLevelBox {
let start_margin = pbm.margin.block_start.auto_is(Length::zero);
collected_margin.adjoin_assign(&CollapsedMargin::new(start_margin));
let contents = match self {
BlockLevelBox::SameFormattingContextBlock { ref contents, .. } => contents,
let child_boxes = match self {
BlockLevelBox::SameFormattingContextBlock { ref contents, .. } => match contents {
BlockContainer::BlockLevelBoxes(boxes) => boxes,
BlockContainer::InlineFormattingContext(_) => return false,
},
_ => return false,
};
@ -92,8 +95,6 @@ impl BlockLevelBox {
return false;
}
match contents {
BlockContainer::BlockLevelBoxes(boxes) => {
let min_inline_size = style
.content_min_box_size(containing_block, &pbm)
.auto_is(Length::zero)
@ -122,15 +123,12 @@ impl BlockLevelBox {
};
if !Self::find_block_margin_collapsing_with_parent_from_slice(
&boxes,
&child_boxes,
collected_margin,
&containing_block_for_children,
) {
return false;
}
},
BlockContainer::InlineFormattingContext(_) => return false,
}
let block_size_zero =
style.content_block_size().is_definitely_zero() || style.content_block_size().is_auto();