From a103d85405b48d9a3a417266749a63a46d96f7f4 Mon Sep 17 00:00:00 2001 From: Pu Xingyu Date: Sun, 4 Jun 2023 20:31:54 +0800 Subject: [PATCH] layout_2020: Allow end margin to collapse with children if height is set to zero Previously, end margin was allowed to collapse only when block size is not set. --- components/layout_2020/flow/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index 22c23253be4..cb88ecebe6a 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -482,7 +482,7 @@ fn layout_in_flow_non_replaced_block_level( let end_margin_can_collapse_with_children = block_is_same_formatting_context && pbm.padding.block_end == Length::zero() && pbm.border.block_end == Length::zero() && - block_size == LengthOrAuto::Auto && + block_size.auto_is(|| Length::zero()) == Length::zero() && min_box_size.block == Length::zero(); let mut clearance = Length::zero();