diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index 7ccb092374b..9c4d9b562ee 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -96,10 +96,18 @@ impl BlockFormattingContext { .collapsed_through ); + // The content height of a BFC root should include any float participating in that BFC + // (https://drafts.csswg.org/css2/#root-height), we implement this by imagining there is + // an element with `clear: both` after the actual contents. + let clearance = sequential_layout_state.map_or(Length::zero(), |sequential_layout_state| { + sequential_layout_state.calculate_clearance(ClearSide::Both) + }); + IndependentLayout { fragments: flow_layout.fragments, content_block_size: flow_layout.content_block_size + - flow_layout.collapsible_margins_in_children.end.solve(), + flow_layout.collapsible_margins_in_children.end.solve() + + clearance, } } } diff --git a/tests/wpt/meta/css/CSS2/floats-clear/float-replaced-height-001.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/float-replaced-height-001.xht.ini deleted file mode 100644 index a04702deda6..00000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/float-replaced-height-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-replaced-height-001.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-005.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-005.xht.ini deleted file mode 100644 index 91e97fbdc18..00000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-005.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-005.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-101.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-101.xht.ini deleted file mode 100644 index 5af3d5999fc..00000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-101.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-101.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-145.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-145.xht.ini deleted file mode 100644 index bca94510418..00000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-145.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-145.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/normal-flow/block-formatting-context-height-001.xht.ini b/tests/wpt/meta/css/CSS2/normal-flow/block-formatting-context-height-001.xht.ini deleted file mode 100644 index 6efb0c8c2c6..00000000000 --- a/tests/wpt/meta/css/CSS2/normal-flow/block-formatting-context-height-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block-formatting-context-height-001.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/normal-flow/block-formatting-context-height-002.xht.ini b/tests/wpt/meta/css/CSS2/normal-flow/block-formatting-context-height-002.xht.ini deleted file mode 100644 index 78396ee399c..00000000000 --- a/tests/wpt/meta/css/CSS2/normal-flow/block-formatting-context-height-002.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block-formatting-context-height-002.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/css-flexbox/change-column-flex-width.html.ini b/tests/wpt/meta/css/css-flexbox/change-column-flex-width.html.ini deleted file mode 100644 index df8814f72bc..00000000000 --- a/tests/wpt/meta/css/css-flexbox/change-column-flex-width.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[change-column-flex-width.html] - [#container 1] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/css/block_formatting_context_containing_floats_a.html.ini b/tests/wpt/mozilla/meta/css/block_formatting_context_containing_floats_a.html.ini deleted file mode 100644 index 433da844606..00000000000 --- a/tests/wpt/mozilla/meta/css/block_formatting_context_containing_floats_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block_formatting_context_containing_floats_a.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/css/float_clearance_intrinsic_width_a.html.ini b/tests/wpt/mozilla/meta/css/float_clearance_intrinsic_width_a.html.ini deleted file mode 100644 index f8d91241d5a..00000000000 --- a/tests/wpt/mozilla/meta/css/float_clearance_intrinsic_width_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float_clearance_intrinsic_width_a.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/css/float_intrinsic_height.html.ini b/tests/wpt/mozilla/meta/css/float_intrinsic_height.html.ini deleted file mode 100644 index 195358c73b4..00000000000 --- a/tests/wpt/mozilla/meta/css/float_intrinsic_height.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float_intrinsic_height.html] - expected: FAIL