diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index 1aee5748c60..da8f5c9f16a 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -1012,7 +1012,7 @@ fn layout_in_flow_non_replaced_block_level_same_formatting_context( let end_margin_can_collapse_with_children = collapsed_through || (pbm.padding.block_end == Au::zero() && pbm.border.block_end == Au::zero() && - computed_block_size.is_auto()); + !containing_block_for_children.size.block.is_definite()); if end_margin_can_collapse_with_children { block_margins_collapsed_with_children .end diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index c6ce4dfd85b..437f621c427 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -248765,6 +248765,71 @@ {} ] ], + "margin-collapse-with-indefinite-block-size-001.html": [ + "47d2a0a043d32ba6220c1dd6a26859908a19bf6e", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], + "margin-collapse-with-indefinite-block-size-002.html": [ + "eb401c92b5e9475129f39be9980f47f42cb2bfa0", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], + "margin-collapse-with-indefinite-block-size-003.html": [ + "51f16f68e6998de4956a5f0615b49406fcacb02e", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], + "margin-collapse-with-indefinite-block-size-004.html": [ + "c393560d6c6ce799943db09468ba8e5cb0e90a5c", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], + "margin-collapse-with-indefinite-block-size-005.html": [ + "27814994aaac7ead76f67d051e8744323e8f4247", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], "max-content-input-001.html": [ "aabbea015748f9276718e2ba9728efc375c8910b", [ diff --git a/tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-001.html b/tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-001.html new file mode 100644 index 00000000000..47d2a0a043d --- /dev/null +++ b/tests/wpt/tests/css/css-sizing/margin-collapse-with-indefinite-block-size-001.html @@ -0,0 +1,23 @@ + + + + + + + + + +
Test passes if there is a filled green square and no red.
+Test passes if there is a filled green square and no red.
+Test passes if there is a filled green square and no red.
+Test passes if there is a filled green square and no red.
+Test passes if there is a filled green square and no red.
+