From cdec48328ed82e9e84d5a9c2ef7d3b6b10a59fe7 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 22 Jul 2020 10:52:11 -0700 Subject: [PATCH 1/3] Place floats in layout 2020, but don't flow text around the floats yet. This commit puts floats behind the `layout.floats.enabled` pref, because of the following issues and unimplemented features: * Inline formatting contexts don't take floats into account, so text doesn't flow around the floats yet. * Non-floated block formatting contexts don't take floats into account, so BFCs can overlap floats. * Block formatting contexts that contain floats don't expand vertically to contain all the floats. That is, floats can stick out the bottom of BFCs, contra spec. --- components/config/prefs.rs | 3 + components/layout_2020/display_list/mod.rs | 2 + .../display_list/stacking_context.rs | 27 +- components/layout_2020/flexbox/layout.rs | 1 + components/layout_2020/flow/float.rs | 426 ++++++++++++++++-- components/layout_2020/flow/inline.rs | 40 +- components/layout_2020/flow/mod.rs | 420 +++++++++++------ components/layout_2020/flow/root.rs | 4 + components/layout_2020/fragments.rs | 53 ++- components/layout_2020/geom.rs | 22 + components/layout_2020/positioned.rs | 3 +- components/layout_2020/query.rs | 6 + components/layout_2020/tests/floats.rs | 54 ++- .../style/properties/longhands/box.mako.rs | 5 +- components/style/values/computed/length.rs | 9 +- resources/prefs.json | 1 + .../metadata-layout-2020/css/CSS2/__dir__.ini | 1 + .../css/CSS2/css1/c414-flt-fit-006.xht.ini | 2 - .../css/CSS2/css1/c414-flt-wrap-001.xht.ini | 2 - .../css/CSS2/css1/c5525-fltwidth-001.xht.ini | 2 + .../floats-clear/adjacent-floats-001.xht.ini | 2 - .../css/CSS2/floats-clear/clear-002.xht.ini | 2 - .../css/CSS2/floats-clear/clear-003.xht.ini | 2 - .../floats-clear/clear-applies-to-000.xht.ini | 2 - .../floats-clear/clear-applies-to-009.xht.ini | 2 - .../clear-clearance-calculation-001.xht.ini | 2 - .../clear-clearance-calculation-002.xht.ini | 2 - .../clear-clearance-calculation-004.xht.ini | 2 - .../clear-clearance-calculation-005.xht.ini | 2 - .../clear-default-inheritance-001.xht.ini | 2 - .../CSS2/floats-clear/clear-float-001.xht.ini | 2 - .../CSS2/floats-clear/clear-float-002.xht.ini | 2 - .../CSS2/floats-clear/clear-float-004.xht.ini | 2 - .../CSS2/floats-clear/clear-float-005.xht.ini | 2 - .../CSS2/floats-clear/clear-float-006.xht.ini | 2 - .../CSS2/floats-clear/clear-float-007.xht.ini | 2 - .../CSS2/floats-clear/clear-float-008.xht.ini | 2 - .../CSS2/floats-clear/clear-float-009.xht.ini | 2 - .../floats-clear/clear-initial-001.xht.ini | 2 - .../clear-no-interpolation.html.ini | 54 --- .../clear-on-child-with-margins-2.html.ini | 2 - .../clear-on-parent-and-child.html.ini | 2 - ...-margin-after-cleared-empty-block.html.ini | 2 + .../CSS2/floats-clear/clearance-006.xht.ini | 2 - .../float-applies-to-001a.xht.ini | 2 - .../float-applies-to-004a.xht.ini | 2 - .../floats-clear/float-applies-to-005.xht.ini | 2 - .../floats-clear/float-applies-to-006.xht.ini | 2 - .../floats-clear/float-applies-to-007.xht.ini | 2 - .../floats-clear/float-applies-to-008.xht.ini | 2 - .../float-applies-to-008a.xht.ini | 2 - .../floats-clear/float-applies-to-009.xht.ini | 2 - .../floats-clear/float-applies-to-012.xht.ini | 2 - .../floats-clear/float-applies-to-015.xht.ini | 2 - .../float-non-replaced-height-001.xht.ini | 2 - .../float-non-replaced-width-001.xht.ini | 2 - .../float-non-replaced-width-003.xht.ini | 2 - .../float-non-replaced-width-004.xht.ini | 2 - .../float-non-replaced-width-005.xht.ini | 2 - .../float-replaced-height-001.xht.ini | 2 + .../float-replaced-width-003.xht.ini | 2 - .../float-replaced-width-004.xht.ini | 2 - .../float-replaced-width-006.xht.ini | 2 - .../float-replaced-width-011.xht.ini | 2 - .../css/CSS2/floats-clear/floats-001.xht.ini | 2 - .../css/CSS2/floats-clear/floats-002.xht.ini | 2 - .../css/CSS2/floats-clear/floats-003.xht.ini | 2 - .../css/CSS2/floats-clear/floats-004.xht.ini | 2 - .../css/CSS2/floats-clear/floats-007.xht.ini | 2 - .../css/CSS2/floats-clear/floats-008.xht.ini | 2 - .../css/CSS2/floats-clear/floats-009.xht.ini | 2 - .../css/CSS2/floats-clear/floats-023.xht.ini | 2 - .../css/CSS2/floats-clear/floats-024.xht.ini | 2 - .../css/CSS2/floats-clear/floats-025.xht.ini | 2 - .../css/CSS2/floats-clear/floats-028.xht.ini | 2 - .../css/CSS2/floats-clear/floats-041.xht.ini | 2 - .../css/CSS2/floats-clear/floats-043.xht.ini | 2 - .../css/CSS2/floats-clear/floats-119.xht.ini | 2 - .../css/CSS2/floats-clear/floats-120.xht.ini | 2 - .../css/CSS2/floats-clear/floats-121.xht.ini | 2 - .../css/CSS2/floats-clear/floats-123.xht.ini | 2 - .../{float-005.xht.ini => floats-132.xht.ini} | 2 +- .../css/CSS2/floats-clear/floats-135.xht.ini | 2 - .../{clear-004.xht.ini => floats-139.xht.ini} | 2 +- .../css/CSS2/floats-clear/floats-141.xht.ini | 2 - .../css/CSS2/floats-clear/floats-144.xht.ini | 2 - .../css/CSS2/floats-clear/floats-146.xht.ini | 2 - .../css/CSS2/floats-clear/floats-147.xht.ini | 2 - .../css/CSS2/floats-clear/floats-154.xht.ini | 2 - .../CSS2/floats-clear/floats-bfc-001.xht.ini | 2 + .../floats-clear-multicol-002.html.ini | 2 - .../floats-clear-multicol-003.html.ini | 2 - ...oats-clear-multicol-balancing-002.html.ini | 2 - ...oats-clear-multicol-balancing-003.html.ini | 2 - .../floats-clear/margin-collapse-018.xht.ini | 2 + .../floats-clear/margin-collapse-023.xht.ini | 2 - .../floats-clear/margin-collapse-027.xht.ini | 2 + .../floats-clear/margin-collapse-165.xht.ini | 2 - .../floats-clear/margin-collapse-166.xht.ini | 2 - ...-to-large-margin-after-left-right.html.ini | 2 - ...-empty-cleared-block-after-margin.html.ini | 2 - ...-float-inside-empty-cleared-block.html.ini | 2 - .../computed-float-position-absolute.html.ini | 3 - .../floats/float-no-interpolation.html.ini | 42 -- .../css/CSS2/floats/float-nowrap-1.html.ini | 2 - .../CSS2/floats/float-nowrap-3-ref.html.ini | 2 - .../css/CSS2/floats/float-nowrap-4.html.ini | 2 + .../css/CSS2/floats/float-nowrap-6.html.ini | 2 + .../css/CSS2/floats/float-root.html.ini | 2 + .../float-table-align-left-quirk.html.ini | 2 + ...t-under-flatten-under-preserve-3d.html.ini | 2 + .../floats-in-table-caption-001.html.ini | 2 + .../CSS2/floats/floats-placement-004.html.ini | 2 + .../CSS2/floats/floats-placement-006.html.ini | 2 - .../floats-placement-vertical-001a.xht.ini | 2 + .../floats-placement-vertical-001b.xht.ini | 2 + .../floats-placement-vertical-001c.xht.ini | 2 + .../floats-placement-vertical-003.xht.ini | 2 + .../floats-rule3-outside-left-001.xht.ini | 2 - .../floats-rule3-outside-right-001.xht.ini | 2 - .../floats-wrap-bfc-outside-001.xht.ini | 2 - .../floats-wrap-bfc-with-margin-004.html.ini | 2 + .../floats-wrap-bfc-with-margin-005.html.ini | 2 + .../CSS2/floats/hit-test-floats-001.html.ini | 3 + .../CSS2/floats/hit-test-floats-002.html.ini | 3 - .../CSS2/floats/hit-test-floats-004.html.ini | 3 + .../CSS2/floats/hit-test-floats-005.html.ini | 3 + ...negative-margin-float-positioning.html.ini | 2 - .../new-fc-separates-from-float.html.ini | 2 - .../zero-space-between-floats-003.html.ini | 3 - .../zero-space-between-floats-004.html.ini | 3 - .../CSS2/floats/zero-width-floats.html.ini | 2 - .../inline-negative-margin-001.html.ini | 27 ++ .../css/CSS2/linebox/line-height-128.xht.ini | 2 - .../margin-collapse-006.xht.ini | 2 - .../margin-collapse-007.xht.ini | 2 - .../margin-right-004.xht.ini | 2 - .../margin-right-005.xht.ini | 2 - .../margin-right-006.xht.ini | 2 - .../margin-right-007.xht.ini | 2 - .../margin-right-016.xht.ini | 2 - .../margin-right-017.xht.ini | 2 - .../margin-right-018.xht.ini | 2 - .../margin-right-028.xht.ini | 2 - .../margin-right-029.xht.ini | 2 - .../margin-right-030.xht.ini | 2 - .../margin-right-040.xht.ini | 2 - .../margin-right-041.xht.ini | 2 - .../margin-right-042.xht.ini | 2 - .../margin-right-052.xht.ini | 2 - .../margin-right-053.xht.ini | 2 - .../margin-right-054.xht.ini | 2 - .../margin-right-064.xht.ini | 2 - .../margin-right-065.xht.ini | 2 - .../margin-right-066.xht.ini | 2 - .../margin-right-076.xht.ini | 2 - .../margin-right-077.xht.ini | 2 - .../margin-right-078.xht.ini | 2 - .../margin-right-088.xht.ini | 2 - .../margin-right-089.xht.ini | 2 - .../margin-right-090.xht.ini | 2 - .../margin-right-109.xht.ini | 2 - .../margin-right-110.xht.ini | 2 - .../margin-right-111.xht.ini | 2 - .../margin-right-112.xht.ini | 2 - .../margin-right-applies-to-009.xht.ini | 2 - .../margin-right-applies-to-012.xht.ini | 2 - .../margin-right-applies-to-013.xht.ini | 2 - .../margin-right-applies-to-014.xht.ini | 2 - .../margin-right-applies-to-015.xht.ini | 2 - .../padding-right-applies-to-009.xht.ini | 2 - .../padding-right-applies-to-013.xht.ini | 2 - .../padding-right-applies-to-014.xht.ini | 2 - ...lock-formatting-context-height-001.xht.ini | 2 + ...lock-formatting-context-height-002.xht.ini | 2 + .../block-formatting-contexts-008.xht.ini | 2 - .../block-formatting-contexts-016.xht.ini | 2 - ...block-in-inline-hittest-float-001.html.ini | 3 + .../block-in-inline-margins-004.html.ini | 2 + .../block-non-replaced-height-011.xht.ini | 2 - ...llapse-through-percentage-padding.html.ini | 2 - .../CSS2/normal-flow/max-width-110.xht.ini | 2 - .../CSS2/normal-flow/min-height-106.xht.ini | 2 + .../width-non-replaced-inline-001.xht.ini | 2 + .../css/CSS2/positioning/abspos-028.xht.ini | 2 - .../line-break-after-leading-float.html.ini | 3 - .../positioning/position-relative-018.xht.ini | 2 - .../positioning/positioning-float-002.xht.ini | 2 - .../css/CSS2/values/units-005.xht.ini | 2 - .../css/CSS2/zindex/stack-floats-003.xht.ini | 2 + .../css/CSS2/zindex/stack-floats-004.xht.ini | 2 + ...ent-on-replaced-element.tentative.html.ini | 3 +- .../mozilla/meta-layout-2020/css/__dir__.ini | 1 + .../css/abs_float_pref_width.html.ini | 2 - .../background_position_shorthand.html.ini | 2 + .../css/block_formatting_context_a.html.ini | 2 + ...ormatting_context_cleared_float_a.html.ini | 2 + ...lock_formatting_context_complex_a.html.ini | 2 + ...tting_context_containing_floats_a.html.ini | 2 + ...ntext_float_inorder_interaction_a.html.ini | 2 + ...matting_context_float_placement_a.html.ini | 2 + ...formatting_context_margin_inout_a.html.ini | 2 - ...ck_formatting_context_max_width_a.html.ini | 2 - ...ock_formatting_context_relative_a.html.ini | 2 + ..._formatting_context_translation_a.html.ini | 2 + .../css/box_sizing_sanity_check_a.html.ini | 2 + .../clear_generated_content_table_a.html.ini | 2 + .../css/first_child_pseudo_a.html.ini | 2 + .../css/first_of_type_pseudo_a.html.ini | 2 + ...overrides_child_intrinsic_width_a.html.ini | 2 + .../css/float-abspos.html.ini | 3 - ...float_clearance_intrinsic_width_a.html.ini | 2 + .../float_cleared_with_just_height.html.ini | 2 - .../css/float_intrinsic_height.html.ini | 2 + .../css/float_relative_to_position.html.ini | 3 - .../css/float_under_top_margin_a.html.ini | 2 + .../css/floated_list_item_a.html.ini | 2 + .../css/floated_negative_margins_a.html.ini | 2 + .../css/floated_table_with_margin_a.html.ini | 2 + ..._margin_collapse_with_clearance_a.html.ini | 2 - .../css/floats_percentage_width_a.html.ini | 2 + .../css/incremental_float_a.html.ini | 2 + .../css/input_alignment_a.html.ini | 2 - .../css/intrinsic_border_box.html.ini | 2 + .../css/last_child_pseudo_a.html.ini | 2 + .../css/last_of_type_pseudo_a.html.ini | 2 + .../css/negative_margin_uncle_a.html.ini | 2 + .../css/nth_child_pseudo_a.html.ini | 2 + .../css/nth_last_child_pseudo_a.html.ini | 2 + .../css/nth_last_of_type_pseudo_a.html.ini | 2 + .../css/nth_of_type_pseudo_a.html.ini | 2 + .../css/only_child_pseudo_a.html.ini | 2 + .../css/only_of_type_pseudo_a.html.ini | 2 + .../css/percentage_height_float_a.html.ini | 2 + .../css/table_float_translation_a.html.ini | 2 + 235 files changed, 1018 insertions(+), 623 deletions(-) create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/__dir__.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/css1/c414-flt-fit-006.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/css1/c414-flt-wrap-001.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/css1/c5525-fltwidth-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/adjacent-floats-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-002.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-003.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-applies-to-000.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-applies-to-009.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-002.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-004.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-005.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-default-inheritance-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-002.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-004.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-005.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-006.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-007.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-008.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-009.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-initial-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-child-with-margins-2.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-parent-and-child.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-with-top-margin-after-cleared-empty-block.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clearance-006.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-001a.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-004a.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-005.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-006.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-007.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-008.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-008a.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-009.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-012.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-015.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-height-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-003.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-004.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-005.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-height-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-003.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-004.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-006.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-011.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-002.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-003.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-004.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-007.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-008.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-009.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-023.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-024.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-025.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-028.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-041.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-043.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-119.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-120.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-121.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-123.xht.ini rename tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/{float-005.xht.ini => floats-132.xht.ini} (50%) delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-135.xht.ini rename tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/{clear-004.xht.ini => floats-139.xht.ini} (50%) delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-141.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-144.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-146.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-147.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-154.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-bfc-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-002.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-003.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-balancing-002.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-balancing-003.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-018.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-023.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-027.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-165.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-166.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/no-clearance-due-to-large-margin-after-left-right.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/second-float-inside-empty-cleared-block-after-margin.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/second-float-inside-empty-cleared-block.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/computed-float-position-absolute.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-1.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-3-ref.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-4.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-6.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/float-root.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/float-table-align-left-quirk.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/float-under-flatten-under-preserve-3d.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-in-table-caption-001.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-004.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-006.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001a.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001b.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001c.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-003.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-rule3-outside-left-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-rule3-outside-right-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-outside-001.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-with-margin-004.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-with-margin-005.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-001.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/negative-margin-float-positioning.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-separates-from-float.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-space-between-floats-003.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-space-between-floats-004.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-width-floats.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/linebox/line-height-128.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-collapse-006.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-collapse-007.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-004.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-005.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-006.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-007.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-016.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-017.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-018.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-028.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-029.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-030.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-040.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-041.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-042.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-052.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-053.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-054.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-064.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-065.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-066.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-076.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-077.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-078.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-088.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-089.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-090.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-109.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-110.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-111.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-112.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-009.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-012.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-013.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-014.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-015.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-009.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-013.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-014.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-context-height-001.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-context-height-002.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-contexts-008.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-contexts-016.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-001.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-margins-004.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-non-replaced-height-011.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/margin-collapse-through-percentage-padding.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/max-width-110.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/min-height-106.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/width-non-replaced-inline-001.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/positioning/abspos-028.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/positioning/line-break-after-leading-float.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/positioning/position-relative-018.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/positioning/positioning-float-002.xht.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/values/units-005.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/zindex/stack-floats-003.xht.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/zindex/stack-floats-004.xht.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/__dir__.ini delete mode 100644 tests/wpt/mozilla/meta-layout-2020/css/abs_float_pref_width.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/background_position_shorthand.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_cleared_float_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_complex_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_containing_floats_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_float_inorder_interaction_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_float_placement_a.html.ini delete mode 100644 tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_margin_inout_a.html.ini delete mode 100644 tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_max_width_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_relative_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_translation_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/box_sizing_sanity_check_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/clear_generated_content_table_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/first_child_pseudo_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/first_of_type_pseudo_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/fixed_width_overrides_child_intrinsic_width_a.html.ini delete mode 100644 tests/wpt/mozilla/meta-layout-2020/css/float-abspos.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/float_clearance_intrinsic_width_a.html.ini delete mode 100644 tests/wpt/mozilla/meta-layout-2020/css/float_cleared_with_just_height.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/float_intrinsic_height.html.ini delete mode 100644 tests/wpt/mozilla/meta-layout-2020/css/float_relative_to_position.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/float_under_top_margin_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/floated_list_item_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/floated_negative_margins_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/floated_table_with_margin_a.html.ini delete mode 100644 tests/wpt/mozilla/meta-layout-2020/css/floats_margin_collapse_with_clearance_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/floats_percentage_width_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/incremental_float_a.html.ini delete mode 100644 tests/wpt/mozilla/meta-layout-2020/css/input_alignment_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/intrinsic_border_box.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/last_child_pseudo_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/last_of_type_pseudo_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/negative_margin_uncle_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/nth_child_pseudo_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/nth_last_child_pseudo_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/nth_last_of_type_pseudo_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/nth_of_type_pseudo_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/only_child_pseudo_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/only_of_type_pseudo_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/percentage_height_float_a.html.ini create mode 100644 tests/wpt/mozilla/meta-layout-2020/css/table_float_translation_a.html.ini diff --git a/components/config/prefs.rs b/components/config/prefs.rs index d72e64ad7c8..fd213766ebe 100644 --- a/components/config/prefs.rs +++ b/components/config/prefs.rs @@ -445,6 +445,9 @@ mod gen { flexbox: { enabled: bool, }, + floats: { + enabled: bool, + }, #[serde(default = "default_layout_threads")] threads: i64, viewport: { diff --git a/components/layout_2020/display_list/mod.rs b/components/layout_2020/display_list/mod.rs index 46636064045..1c1990b739d 100644 --- a/components/layout_2020/display_list/mod.rs +++ b/components/layout_2020/display_list/mod.rs @@ -200,6 +200,8 @@ impl Fragment { Visibility::Hidden => (), Visibility::Collapse => (), }, + Fragment::HoistedFloat(_) => {}, + Fragment::Float => {}, Fragment::AbsoluteOrFixedPositioned(_) => {}, Fragment::Anonymous(_) => {}, Fragment::Image(i) => match i.style.get_inherited_box().visibility { diff --git a/components/layout_2020/display_list/stacking_context.rs b/components/layout_2020/display_list/stacking_context.rs index d4995d8cfc3..b9489308318 100644 --- a/components/layout_2020/display_list/stacking_context.rs +++ b/components/layout_2020/display_list/stacking_context.rs @@ -7,7 +7,7 @@ use crate::cell::ArcRefCell; use crate::display_list::conversions::ToWebRender; use crate::display_list::DisplayListBuilder; use crate::fragment_tree::ContainingBlockManager; -use crate::fragments::{AnonymousFragment, BoxFragment, Fragment}; +use crate::fragments::{AnonymousFragment, BoxFragment, Fragment, HoistedFloatFragment}; use crate::geom::PhysicalRect; use crate::style_ext::ComputedValuesExt; use crate::FragmentTree; @@ -554,6 +554,14 @@ impl Fragment { stacking_context, ); }, + Fragment::HoistedFloat(fragment) => { + fragment.build_stacking_context_tree( + display_list, + containing_block_info, + stacking_context, + ); + }, + Fragment::Float => {}, Fragment::AbsoluteOrFixedPositioned(fragment) => { let shared_fragment = fragment.borrow(); let fragment_ref = match shared_fragment.fragment.as_ref() { @@ -1095,3 +1103,20 @@ impl AnonymousFragment { } } } + +impl HoistedFloatFragment { + fn build_stacking_context_tree( + &self, + display_list: &mut DisplayList, + containing_block_info: &ContainingBlockInfo, + stacking_context: &mut StackingContext, + ) { + self.fragment.borrow().build_stacking_context_tree( + &self.fragment, + display_list, + containing_block_info, + stacking_context, + StackingContextBuildMode::SkipHoisted, + ); + } +} diff --git a/components/layout_2020/flexbox/layout.rs b/components/layout_2020/flexbox/layout.rs index 1c8001d9b95..24e514b8010 100644 --- a/components/layout_2020/flexbox/layout.rs +++ b/components/layout_2020/flexbox/layout.rs @@ -800,6 +800,7 @@ impl FlexLine<'_> { flex_context.sides_to_flow_relative(item.padding), flex_context.sides_to_flow_relative(item.border), margin, + Length::zero(), collapsed_margin, ) }) diff --git a/components/layout_2020/flow/float.rs b/components/layout_2020/flow/float.rs index eeae46cba61..d85b364b694 100644 --- a/components/layout_2020/flow/float.rs +++ b/components/layout_2020/flow/float.rs @@ -6,16 +6,25 @@ //! //! See CSS 2.1 § 9.5.1: https://www.w3.org/TR/CSS2/visuren.html#float-position +use crate::cell::ArcRefCell; use crate::context::LayoutContext; use crate::dom::NodeExt; use crate::dom_traversal::{Contents, NodeAndStyleInfo}; use crate::formatting_contexts::IndependentFormattingContext; +use crate::fragments::{BoxFragment, CollapsedBlockMargins, CollapsedMargin, FloatFragment}; +use crate::fragments::{Fragment, HoistedFloatFragment}; use crate::geom::flow_relative::{Rect, Vec2}; -use crate::style_ext::DisplayInside; +use crate::positioned::PositioningContext; +use crate::style_ext::{ComputedValuesExt, DisplayInside}; +use crate::ContainingBlock; use euclid::num::Zero; use servo_arc::Arc; use std::f32; +use std::fmt::{Debug, Formatter, Result as FmtResult}; use std::ops::Range; +use style::computed_values::clear::T as ClearProperty; +use style::computed_values::float::T as FloatProperty; +use style::properties::ComputedValues; use style::values::computed::Length; use style::values::specified::text::TextDecorationLine; @@ -40,6 +49,25 @@ pub struct FloatContext { /// The current (logically) vertical position. No new floats may be placed (logically) above /// this line. pub ceiling: Length, + /// Distances from the logical left side of the block formatting context to the logical sides + /// of the current containing block. + pub walls: InlineWalls, + /// The (logically) lowest margin edge of the last left float. + pub clear_left_position: Length, + /// The (logically) lowest margin edge of the last right float. + pub clear_right_position: Length, +} + +/// Distances from the logical left side of the block formatting context to the logical sides of +/// the current containing block. +#[derive(Clone, Copy, Debug)] +pub struct InlineWalls { + /// The distance from the logical left side of the block formatting context to the logical + /// left side of the current containing block. + pub left: Length, + /// The distance from the logical *left* side of the block formatting context to the logical + /// right side of this object's containing block. + pub right: Length, } impl FloatContext { @@ -60,6 +88,9 @@ impl FloatContext { FloatContext { bands, ceiling: Length::zero(), + walls: InlineWalls::new(), + clear_left_position: Length::zero(), + clear_right_position: Length::zero(), } } @@ -81,9 +112,19 @@ impl FloatContext { /// This should be used for placing inline elements and block formatting contexts so that they /// don't collide with floats. pub fn place_object(&self, object: &PlacementInfo) -> Vec2 { + let ceiling = match object.clear { + ClearSide::None => self.ceiling, + ClearSide::Left => self.ceiling.max(self.clear_left_position), + ClearSide::Right => self.ceiling.max(self.clear_right_position), + ClearSide::Both => self + .ceiling + .max(self.clear_left_position) + .max(self.clear_right_position), + }; + // Find the first band this float fits in. - let mut first_band = self.bands.find(self.ceiling).unwrap(); - while !first_band.object_fits(&object) { + let mut first_band = self.bands.find(ceiling).unwrap(); + while !first_band.object_fits(&object, &self.walls) { let next_band = self.bands.find_next(first_band.top).unwrap(); if next_band.top.px().is_infinite() { break; @@ -95,8 +136,8 @@ impl FloatContext { match object.side { FloatSide::Left => { let left_object_edge = match first_band.left { - Some(band_left) => band_left.max(object.left_wall), - None => object.left_wall, + Some(band_left) => band_left.max(self.walls.left), + None => self.walls.left, }; Vec2 { inline: left_object_edge, @@ -105,8 +146,8 @@ impl FloatContext { }, FloatSide::Right => { let right_object_edge = match first_band.right { - Some(band_right) => band_right.min(object.right_wall), - None => object.right_wall, + Some(band_right) => band_right.min(self.walls.right), + None => self.walls.right, }; Vec2 { inline: right_object_edge - object.size.inline, @@ -129,6 +170,20 @@ impl FloatContext { size: new_float.size.clone(), }; + // Update clear. + match new_float.side { + FloatSide::Left => { + self.clear_left_position = self + .clear_left_position + .max(new_float_rect.max_block_position()) + }, + FloatSide::Right => { + self.clear_right_position = self + .clear_right_position + .max(new_float_rect.max_block_position()) + }, + } + // Split the first band if necessary. let mut first_band = self.bands.find(new_float_rect.start_corner.block).unwrap(); first_band.top = new_float_rect.start_corner.block; @@ -155,6 +210,15 @@ impl FloatContext { } } +impl InlineWalls { + fn new() -> InlineWalls { + InlineWalls { + left: Length::zero(), + right: Length::new(f32::INFINITY), + } + } +} + /// Information needed to place an object so that it doesn't collide with existing floats. #[derive(Clone, Debug)] pub struct PlacementInfo { @@ -164,12 +228,6 @@ pub struct PlacementInfo { pub side: FloatSide, /// Which side or sides to clear floats on. pub clear: ClearSide, - /// The distance from the logical left side of the block formatting context to the logical - /// left side of this object's containing block. - pub left_wall: Length, - /// The distance from the logical *left* side of the block formatting context to the logical - /// right side of this object's containing block. - pub right_wall: Length, } /// Whether the float is left or right. @@ -210,39 +268,41 @@ pub struct FloatBand { pub right: Option, } -impl FloatBand { - // Returns true if this band is clear of floats on the given side or sides. - fn is_clear(&self, side: ClearSide) -> bool { - match (side, self.left, self.right) { - (ClearSide::Left, Some(_), _) | - (ClearSide::Right, _, Some(_)) | - (ClearSide::Both, Some(_), _) | - (ClearSide::Both, _, Some(_)) => false, - (ClearSide::None, _, _) | - (ClearSide::Left, None, _) | - (ClearSide::Right, _, None) | - (ClearSide::Both, None, None) => true, +impl FloatSide { + fn from_style(style: &ComputedValues) -> Option { + match style.get_box().float { + FloatProperty::None => None, + FloatProperty::Left => Some(FloatSide::Left), + FloatProperty::Right => Some(FloatSide::Right), } } +} - // Determines whether an object fits in a band. - fn object_fits(&self, object: &PlacementInfo) -> bool { - // If we must be clear on the given side and we aren't, this object doesn't fit. - if !self.is_clear(object.clear) { - return false; +impl ClearSide { + pub(crate) fn from_style(style: &ComputedValues) -> ClearSide { + match style.get_box().clear { + ClearProperty::None => ClearSide::None, + ClearProperty::Left => ClearSide::Left, + ClearProperty::Right => ClearSide::Right, + ClearProperty::Both => ClearSide::Both, } + } +} +impl FloatBand { + // Determines whether an object fits in a band. + fn object_fits(&self, object: &PlacementInfo, walls: &InlineWalls) -> bool { match object.side { FloatSide::Left => { // Compute a candidate left position for the object. let candidate_left = match self.left { - None => object.left_wall, - Some(left) => left.max(object.left_wall), + None => walls.left, + Some(left) => left.max(walls.left), }; // If this band has an existing left float in it, then make sure that the object // doesn't stick out past the right edge (rule 7). - if self.left.is_some() && candidate_left + object.size.inline > object.right_wall { + if self.left.is_some() && candidate_left + object.size.inline > walls.right { return false; } @@ -257,13 +317,13 @@ impl FloatBand { FloatSide::Right => { // Compute a candidate right position for the object. let candidate_right = match self.right { - None => object.right_wall, - Some(right) => right.min(object.right_wall), + None => walls.right, + Some(right) => right.min(walls.right), }; // If this band has an existing right float in it, then make sure that the new // object doesn't stick out past the left edge (rule 7). - if self.right.is_some() && candidate_right - object.size.inline < object.left_wall { + if self.right.is_some() && candidate_right - object.size.inline < walls.left { return false; } @@ -540,6 +600,12 @@ impl FloatBandLink { } } +impl Debug for FloatFragment { + fn fmt(&self, formatter: &mut Formatter) -> FmtResult { + write!(formatter, "FloatFragment") + } +} + // Float boxes impl FloatBox { @@ -561,4 +627,292 @@ impl FloatBox { ), } } + + pub fn layout( + &mut self, + layout_context: &LayoutContext, + positioning_context: &mut PositioningContext, + containing_block: &ContainingBlock, + mut sequential_layout_state: Option<&mut SequentialLayoutState>, + ) { + let sequential_layout_state = sequential_layout_state + .as_mut() + .expect("Tried to lay out a float with no sequential placement state!"); + + // Speculate that the float ceiling will be located at the current block position plus the + // result of solving any margins we're building up. This is usually right, but it can be + // incorrect if there are more in-flow collapsible margins yet to be seen. An example + // showing when this can go wrong: + // + //
+ //
+ //
+ // + // Assuming these are all in-flow, the float should be placed 10px down from the start, not + // 5px, but we can't know that because we haven't seen the block after this float yet. + // + // FIXME(pcwalton): Implement the proper behavior when speculation fails. Either detect it + // afterward and fix it up, or detect this situation ahead of time via lookahead and make + // sure `current_margin` is accurate before calling this method. + sequential_layout_state.floats.lower_ceiling( + sequential_layout_state.bfc_relative_block_position + + sequential_layout_state.current_margin.solve(), + ); + + let style = match self.contents { + IndependentFormattingContext::Replaced(ref replaced) => replaced.style.clone(), + IndependentFormattingContext::NonReplaced(ref non_replaced) => { + non_replaced.style.clone() + }, + }; + let float_context = &mut sequential_layout_state.floats; + let box_fragment = positioning_context.layout_maybe_position_relative_fragment( + layout_context, + containing_block, + &style, + |mut positioning_context| { + // Margin is computed this way regardless of whether the element is replaced + // or non-replaced. + let pbm = style.padding_border_margin(containing_block); + let margin = pbm.margin.auto_is(|| Length::zero()); + let pbm_sums = &(&pbm.padding + &pbm.border) + &margin; + + let (content_size, fragments); + match self.contents { + IndependentFormattingContext::NonReplaced(ref mut non_replaced) => { + // Calculate inline size. + // https://drafts.csswg.org/css2/#float-width + let box_size = non_replaced.style.content_box_size(&containing_block, &pbm); + let max_box_size = non_replaced + .style + .content_max_box_size(&containing_block, &pbm); + let min_box_size = non_replaced + .style + .content_min_box_size(&containing_block, &pbm) + .auto_is(Length::zero); + + let tentative_inline_size = box_size.inline.auto_is(|| { + let available_size = + containing_block.inline_size - pbm_sums.inline_sum(); + non_replaced + .inline_content_sizes(layout_context) + .shrink_to_fit(available_size) + }); + let inline_size = tentative_inline_size + .clamp_between_extremums(min_box_size.inline, max_box_size.inline); + + // Calculate block size. + // https://drafts.csswg.org/css2/#block-root-margin + // FIXME(pcwalton): Is a tree rank of zero correct here? + let containing_block_for_children = ContainingBlock { + inline_size, + block_size: box_size.block, + style: &non_replaced.style, + }; + let independent_layout = non_replaced.layout( + layout_context, + &mut positioning_context, + &containing_block_for_children, + 0, + ); + content_size = Vec2 { + inline: inline_size, + block: box_size + .block + .auto_is(|| independent_layout.content_block_size), + }; + fragments = independent_layout.fragments; + }, + IndependentFormattingContext::Replaced(ref replaced) => { + // https://drafts.csswg.org/css2/#float-replaced-width + // https://drafts.csswg.org/css2/#inline-replaced-height + content_size = replaced.contents.used_size_as_if_inline_element( + &containing_block, + &replaced.style, + None, + &pbm, + ); + fragments = replaced + .contents + .make_fragments(&replaced.style, content_size.clone()); + }, + }; + + let margin_box_start_corner = float_context.add_float(&PlacementInfo { + size: &content_size + &pbm_sums.sum(), + side: FloatSide::from_style(&style).expect("Float box wasn't floated!"), + clear: ClearSide::from_style(&style), + }); + + let content_rect = Rect { + start_corner: &margin_box_start_corner + &pbm_sums.start_offset(), + size: content_size.clone(), + }; + + // Clearance is handled internally by the float placement logic, so there's no need + // to store it explicitly in the fragment. + let clearance = Length::zero(); + + BoxFragment::new( + self.contents.base_fragment_info(), + style.clone(), + fragments, + content_rect, + pbm.padding, + pbm.border, + margin, + clearance, + CollapsedBlockMargins::zero(), + ) + }, + ); + sequential_layout_state.push_float_fragment(ArcRefCell::new(Fragment::Box(box_fragment))); + } +} + +// Float fragment storage + +// A persistent linked list that stores float fragments that need to be hoisted to their nearest +// ancestor containing block. +#[derive(Clone)] +struct FloatFragmentList { + root: FloatFragmentLink, +} + +// A single link in the float fragment list. +#[derive(Clone)] +struct FloatFragmentLink(Option>); + +// A single node in the float fragment list. +#[derive(Clone)] +struct FloatFragmentNode { + // The fragment. + fragment: ArcRefCell, + // The next fragment (previous in document order). + next: FloatFragmentLink, +} + +impl FloatFragmentList { + fn new() -> FloatFragmentList { + FloatFragmentList { + root: FloatFragmentLink(None), + } + } +} + +// Sequential layout state + +// Layout state that we maintain when doing sequential traversals of the box tree in document +// order. +// +// This data is only needed for float placement and float interaction, and as such is only present +// if the current block formatting context contains floats. +// +// All coordinates here are relative to the start of the nearest ancestor block formatting context. +// +// This structure is expected to be cheap to clone, in order to allow for "snapshots" that enable +// restarting layout at any point in the tree. +#[derive(Clone)] +pub(crate) struct SequentialLayoutState { + // Holds all floats in this block formatting context. + pub(crate) floats: FloatContext, + // A list of all float fragments in this block formatting context. These are gathered up and + // hoisted to the top of the BFC. + bfc_float_fragments: FloatFragmentList, + // The (logically) bottom border edge or top padding edge of the last in-flow block. Floats + // cannot be placed above this line. + // + // This is often, but not always, the same as the float ceiling. The float ceiling can be lower + // than this value because this value is calculated based on in-flow boxes only, while + // out-of-flow floats can affect the ceiling as well (see CSS 2.1 § 9.5.1 rule 6). + bfc_relative_block_position: Length, + // Any collapsible margins that we've encountered after `bfc_relative_block_position`. + current_margin: CollapsedMargin, +} + +impl SequentialLayoutState { + // Creates a new empty `SequentialLayoutState`. + pub(crate) fn new() -> SequentialLayoutState { + SequentialLayoutState { + floats: FloatContext::new(), + current_margin: CollapsedMargin::zero(), + bfc_relative_block_position: Length::zero(), + bfc_float_fragments: FloatFragmentList::new(), + } + } + + // Moves the current block position (logically) down by `block_distance`. + // + // Floats may not be placed higher than the current block position. + pub(crate) fn advance_block_position(&mut self, block_distance: Length) { + self.bfc_relative_block_position += block_distance; + self.floats.lower_ceiling(self.bfc_relative_block_position); + } + + // Collapses margins, moving the block position down by the collapsed value of `current_margin` + // and resetting `current_margin` to zero. + // + // Call this method before laying out children when it is known that the start margin of the + // current fragment can't collapse with the margins of any of its children. + pub(crate) fn collapse_margins(&mut self) { + self.advance_block_position(self.current_margin.solve()); + self.current_margin = CollapsedMargin::zero(); + } + + // Returns the amount of clearance that a block with the given `clear` value at the current + // `bfc_relative_block_position` (with top margin included in `current_margin` if applicable) + // needs to have. + // + // https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#flow-control + pub(crate) fn calculate_clearance(&self, clear_side: ClearSide) -> Length { + if clear_side == ClearSide::None { + return Length::zero(); + } + + let hypothetical_block_position = + self.bfc_relative_block_position + self.current_margin.solve(); + let clear_position = match clear_side { + ClearSide::None => unreachable!(), + ClearSide::Left => self + .floats + .clear_left_position + .max(hypothetical_block_position), + ClearSide::Right => self + .floats + .clear_right_position + .max(hypothetical_block_position), + ClearSide::Both => self + .floats + .clear_left_position + .max(self.floats.clear_right_position) + .max(hypothetical_block_position), + }; + clear_position - hypothetical_block_position + } + + /// Adds a new adjoining margin. + pub(crate) fn adjoin_assign(&mut self, margin: &CollapsedMargin) { + self.current_margin.adjoin_assign(margin) + } + + /// Adds the float fragment to this list. + pub(crate) fn push_float_fragment(&mut self, new_float_fragment: ArcRefCell) { + self.bfc_float_fragments.root.0 = Some(Arc::new(FloatFragmentNode { + fragment: new_float_fragment, + next: FloatFragmentLink(self.bfc_float_fragments.root.0.take()), + })); + } + + /// Adds the float fragments we've been building up to the given vector. + pub(crate) fn add_float_fragments_to_list(&self, fragment_list: &mut Vec) { + let start_index = fragment_list.len(); + let mut link = &self.bfc_float_fragments.root; + while let Some(ref node) = link.0 { + fragment_list.push(Fragment::HoistedFloat(HoistedFloatFragment { + fragment: node.fragment.clone(), + })); + link = &node.next; + } + fragment_list[start_index..].reverse(); + } } diff --git a/components/layout_2020/flow/inline.rs b/components/layout_2020/flow/inline.rs index c59ffca9215..4bf9ec5012a 100644 --- a/components/layout_2020/flow/inline.rs +++ b/components/layout_2020/flow/inline.rs @@ -4,7 +4,7 @@ use crate::cell::ArcRefCell; use crate::context::LayoutContext; -use crate::flow::float::FloatBox; +use crate::flow::float::{FloatBox, SequentialLayoutState}; use crate::flow::FlowLayout; use crate::formatting_contexts::IndependentFormattingContext; use crate::fragment_tree::BaseFragmentInfo; @@ -99,6 +99,7 @@ struct InlineFormattingContextState<'box_tree, 'a, 'b> { inline_position: Length, partial_inline_boxes_stack: Vec>, current_nesting_level: InlineNestingLevelState<'box_tree>, + sequential_layout_state: Option<&'a mut SequentialLayoutState>, } impl<'box_tree, 'a, 'b> InlineFormattingContextState<'box_tree, 'a, 'b> { @@ -271,6 +272,7 @@ impl InlineFormattingContext { positioning_context: &mut PositioningContext, containing_block: &ContainingBlock, tree_rank: usize, + sequential_layout_state: Option<&mut SequentialLayoutState>, ) -> FlowLayout { let mut ifc = InlineFormattingContextState { positioning_context, @@ -298,8 +300,15 @@ impl InlineFormattingContext { positioning_context: None, text_decoration_line: self.text_decoration_line, }, + sequential_layout_state, }; + // FIXME(pcwalton): This assumes that margins never collapse through inline formatting + // contexts (i.e. that inline formatting contexts are never empty). Is that right? + if let Some(ref mut sequential_layout_state) = ifc.sequential_layout_state { + sequential_layout_state.collapse_margins(); + } + loop { if let Some(child) = ifc.current_nesting_level.remaining_boxes.next() { match &mut *child.borrow_mut() { @@ -342,8 +351,16 @@ impl InlineFormattingContext { .fragments_so_far .push(Fragment::AbsoluteOrFixedPositioned(hoisted_fragment)); }, - InlineLevelBox::OutOfFlowFloatBox(_box_) => { - // TODO + InlineLevelBox::OutOfFlowFloatBox(box_) => { + box_.layout( + layout_context, + ifc.positioning_context, + containing_block, + ifc.sequential_layout_state.as_mut().map(|c| &mut **c), + ); + ifc.current_nesting_level + .fragments_so_far + .push(Fragment::Float); }, } } else @@ -360,6 +377,7 @@ impl InlineFormattingContext { ifc.lines.finish_line( &mut ifc.current_nesting_level, containing_block, + ifc.sequential_layout_state, ifc.inline_position, ); return FlowLayout { @@ -377,6 +395,7 @@ impl Lines { &mut self, top_nesting_level: &mut InlineNestingLevelState, containing_block: &ContainingBlock, + mut sequential_layout_state: Option<&mut SequentialLayoutState>, line_content_inline_size: Length, ) { let mut line_contents = std::mem::take(&mut top_nesting_level.fragments_so_far); @@ -430,7 +449,11 @@ impl Lines { inline: containing_block.inline_size, block: line_block_size, }; + self.next_line_block_position += size.block; + if let Some(ref mut sequential_layout_state) = sequential_layout_state { + sequential_layout_state.advance_block_position(size.block); + } self.fragments .push(Fragment::Anonymous(AnonymousFragment::new( @@ -519,6 +542,7 @@ impl<'box_tree> PartialInlineBoxFragment<'box_tree> { self.padding.clone(), self.border.clone(), self.margin.clone(), + Length::zero(), CollapsedBlockMargins::zero(), ); let last_fragment = self.last_box_tree_fragment && !at_line_break; @@ -583,6 +607,7 @@ fn layout_atomic( pbm.padding, pbm.border, margin, + Length::zero(), CollapsedBlockMargins::zero(), ) }, @@ -658,6 +683,7 @@ fn layout_atomic( pbm.padding, pbm.border, margin, + Length::zero(), CollapsedBlockMargins::zero(), ) }, @@ -861,8 +887,12 @@ impl TextRun { partial.parent_nesting_level.inline_start = Length::zero(); nesting_level = &mut partial.parent_nesting_level; } - ifc.lines - .finish_line(nesting_level, ifc.containing_block, ifc.inline_position); + ifc.lines.finish_line( + nesting_level, + ifc.containing_block, + ifc.sequential_layout_state.as_mut().map(|c| &mut **c), + ifc.inline_position, + ); ifc.inline_position = Length::zero(); } } diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index 73630acf7bd..f2e6283a3ec 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -6,15 +6,13 @@ use crate::cell::ArcRefCell; use crate::context::LayoutContext; -use crate::flow::float::{FloatBox, FloatContext}; +use crate::flow::float::{ClearSide, FloatBox, SequentialLayoutState}; use crate::flow::inline::InlineFormattingContext; use crate::formatting_contexts::{ IndependentFormattingContext, IndependentLayout, NonReplacedFormattingContext, }; use crate::fragment_tree::BaseFragmentInfo; -use crate::fragments::{ - AnonymousFragment, BoxFragment, CollapsedBlockMargins, CollapsedMargin, Fragment, -}; +use crate::fragments::{BoxFragment, CollapsedBlockMargins, CollapsedMargin, Fragment}; use crate::geom::flow_relative::{Rect, Sides, Vec2}; use crate::positioned::{AbsolutelyPositionedBox, PositioningContext}; use crate::replaced::ReplacedContent; @@ -78,26 +76,31 @@ impl BlockFormattingContext { containing_block: &ContainingBlock, tree_rank: usize, ) -> IndependentLayout { - let mut float_context; - let float_context = if self.contains_floats { - float_context = FloatContext::new(); - Some(&mut float_context) + let mut sequential_layout_state = if self.contains_floats || !layout_context.use_rayon { + Some(SequentialLayoutState::new()) } else { None }; - let flow_layout = self.contents.layout( + + let mut flow_layout = self.contents.layout( layout_context, positioning_context, containing_block, tree_rank, - float_context, + sequential_layout_state.as_mut(), CollapsibleWithParentStartMargin(false), ); - assert!( + debug_assert!( !flow_layout .collapsible_margins_in_children .collapsed_through ); + + // FIXME(pcwalton): Relative positioning of ancestors should affect descendant floats. + if let Some(ref sequential_layout_state) = sequential_layout_state { + sequential_layout_state.add_float_fragments_to_list(&mut flow_layout.fragments); + } + IndependentLayout { fragments: flow_layout.fragments, content_block_size: flow_layout.content_block_size + @@ -113,7 +116,7 @@ impl BlockContainer { positioning_context: &mut PositioningContext, containing_block: &ContainingBlock, tree_rank: usize, - float_context: Option<&mut FloatContext>, + sequential_layout_state: Option<&mut SequentialLayoutState>, collapsible_with_parent_start_margin: CollapsibleWithParentStartMargin, ) -> FlowLayout { match self { @@ -123,7 +126,7 @@ impl BlockContainer { child_boxes, containing_block, tree_rank, - float_context, + sequential_layout_state, collapsible_with_parent_start_margin, ), BlockContainer::InlineFormattingContext(ifc) => ifc.layout( @@ -131,6 +134,7 @@ impl BlockContainer { positioning_context, containing_block, tree_rank, + sequential_layout_state, ), } } @@ -169,130 +173,110 @@ fn layout_block_level_children( child_boxes: &[ArcRefCell], containing_block: &ContainingBlock, tree_rank: usize, - mut float_context: Option<&mut FloatContext>, + mut sequential_layout_state: Option<&mut SequentialLayoutState>, collapsible_with_parent_start_margin: CollapsibleWithParentStartMargin, ) -> FlowLayout { - fn place_block_level_fragment(fragment: &mut Fragment, placement_state: &mut PlacementState) { - match fragment { - Fragment::Box(fragment) => { - let fragment_block_margins = &fragment.block_margins_collapsed_with_children; - let fragment_block_size = fragment.padding.block_sum() + - fragment.border.block_sum() + - fragment.content_rect.size.block; - - if placement_state.next_in_flow_margin_collapses_with_parent_start_margin { - assert_eq!(placement_state.current_margin.solve(), Length::zero()); - placement_state - .start_margin - .adjoin_assign(&fragment_block_margins.start); - if fragment_block_margins.collapsed_through { - placement_state - .start_margin - .adjoin_assign(&fragment_block_margins.end); - return; - } - placement_state.next_in_flow_margin_collapses_with_parent_start_margin = false; - } else { - placement_state - .current_margin - .adjoin_assign(&fragment_block_margins.start); - } - fragment.content_rect.start_corner.block += placement_state.current_margin.solve() + - placement_state.current_block_direction_position; - if fragment_block_margins.collapsed_through { - placement_state - .current_margin - .adjoin_assign(&fragment_block_margins.end); - return; - } - placement_state.current_block_direction_position += - placement_state.current_margin.solve() + fragment_block_size; - placement_state.current_margin = fragment_block_margins.end; - }, - Fragment::AbsoluteOrFixedPositioned(fragment) => { - let offset = Vec2 { - block: placement_state.current_margin.solve() + - placement_state.current_block_direction_position, - inline: Length::new(0.), - }; - fragment.borrow_mut().adjust_offsets(offset); - }, - Fragment::Anonymous(_) => {}, - _ => unreachable!(), - } + match sequential_layout_state { + Some(ref mut sequential_layout_state) => layout_block_level_children_sequentially( + layout_context, + positioning_context, + child_boxes, + containing_block, + tree_rank, + sequential_layout_state, + collapsible_with_parent_start_margin, + ), + None => layout_block_level_children_in_parallel( + layout_context, + positioning_context, + child_boxes, + containing_block, + tree_rank, + collapsible_with_parent_start_margin, + ), } +} - struct PlacementState { - next_in_flow_margin_collapses_with_parent_start_margin: bool, - start_margin: CollapsedMargin, - current_margin: CollapsedMargin, - current_block_direction_position: Length, - } +fn layout_block_level_children_in_parallel( + layout_context: &LayoutContext, + positioning_context: &mut PositioningContext, + child_boxes: &[ArcRefCell], + containing_block: &ContainingBlock, + tree_rank: usize, + collapsible_with_parent_start_margin: CollapsibleWithParentStartMargin, +) -> FlowLayout { + let mut placement_state = PlacementState::new(collapsible_with_parent_start_margin); - let mut placement_state = PlacementState { - next_in_flow_margin_collapses_with_parent_start_margin: - collapsible_with_parent_start_margin.0, - start_margin: CollapsedMargin::zero(), - current_margin: CollapsedMargin::zero(), - current_block_direction_position: Length::zero(), - }; let fragments = positioning_context.adjust_static_positions(tree_rank, |positioning_context| { - if float_context.is_some() || !layout_context.use_rayon { - // Because floats are involved, we do layout for this block formatting context - // in tree order without parallelism. This enables mutable access - // to a `FloatContext` that tracks every float encountered so far (again in tree order). - child_boxes - .iter() - .enumerate() - .map(|(tree_rank, box_)| { - let mut fragment = box_.borrow_mut().layout( + let collects_for_nearest_positioned_ancestor = + positioning_context.collects_for_nearest_positioned_ancestor(); + let mut fragments: Vec = child_boxes + .par_iter() + .enumerate() + .mapfold_reduce_into( + positioning_context, + |positioning_context, (tree_rank, box_)| { + box_.borrow_mut().layout( layout_context, positioning_context, containing_block, tree_rank, - float_context.as_mut().map(|c| &mut **c), - ); - place_block_level_fragment(&mut fragment, &mut placement_state); - fragment - }) - .collect() - } else { - let collects_for_nearest_positioned_ancestor = - positioning_context.collects_for_nearest_positioned_ancestor(); - let mut fragments = child_boxes - .par_iter() - .enumerate() - .mapfold_reduce_into( - positioning_context, - |positioning_context, (tree_rank, box_)| { - box_.borrow_mut().layout( - layout_context, - positioning_context, - containing_block, - tree_rank, - /* float_context = */ None, - ) - }, - || PositioningContext::new_for_rayon(collects_for_nearest_positioned_ancestor), - PositioningContext::append, - ) - .collect(); - for fragment in &mut fragments { - place_block_level_fragment(fragment, &mut placement_state) - } - fragments + /* sequential_layout_state = */ None, + ) + }, + || PositioningContext::new_for_rayon(collects_for_nearest_positioned_ancestor), + PositioningContext::append, + ) + .collect(); + for fragment in fragments.iter_mut() { + placement_state.place_fragment(fragment); } + fragments }); FlowLayout { fragments, content_block_size: placement_state.current_block_direction_position, - collapsible_margins_in_children: CollapsedBlockMargins { - collapsed_through: placement_state - .next_in_flow_margin_collapses_with_parent_start_margin, - start: placement_state.start_margin, - end: placement_state.current_margin, - }, + collapsible_margins_in_children: placement_state.collapsible_margins_in_children(), + } +} + +fn layout_block_level_children_sequentially( + layout_context: &LayoutContext, + positioning_context: &mut PositioningContext, + child_boxes: &[ArcRefCell], + containing_block: &ContainingBlock, + tree_rank: usize, + sequential_layout_state: &mut SequentialLayoutState, + collapsible_with_parent_start_margin: CollapsibleWithParentStartMargin, +) -> FlowLayout { + let mut placement_state = PlacementState::new(collapsible_with_parent_start_margin); + + let fragments = positioning_context.adjust_static_positions(tree_rank, |positioning_context| { + // Because floats are involved, we do layout for this block formatting context in tree + // order without parallelism. This enables mutable access to a `SequentialLayoutState` that + // tracks every float encountered so far (again in tree order). + child_boxes + .iter() + .enumerate() + .map(|(tree_rank, child_box)| { + let mut fragment = child_box.borrow_mut().layout( + layout_context, + positioning_context, + containing_block, + tree_rank, + Some(&mut *sequential_layout_state), + ); + placement_state.place_fragment(&mut fragment); + fragment + }) + .collect() + }); + + FlowLayout { + fragments, + content_block_size: placement_state.current_block_direction_position, + collapsible_margins_in_children: placement_state.collapsible_margins_in_children(), } } @@ -303,7 +287,7 @@ impl BlockLevelBox { positioning_context: &mut PositioningContext, containing_block: &ContainingBlock, tree_rank: usize, - float_context: Option<&mut FloatContext>, + sequential_layout_state: Option<&mut SequentialLayoutState>, ) -> Fragment { match self { BlockLevelBox::SameFormattingContextBlock { @@ -323,7 +307,7 @@ impl BlockLevelBox { style, NonReplacedContents::SameFormattingContextBlock(contents), tree_rank, - float_context, + sequential_layout_state, ) }, )), @@ -339,6 +323,7 @@ impl BlockLevelBox { replaced.base_fragment_info, &replaced.style, &replaced.contents, + sequential_layout_state, ) }, )) @@ -359,7 +344,7 @@ impl BlockLevelBox { non_replaced, ), tree_rank, - float_context, + sequential_layout_state, ) }, )) @@ -379,11 +364,14 @@ impl BlockLevelBox { positioning_context.push(hoisted_box); Fragment::AbsoluteOrFixedPositioned(hoisted_fragment) }, - BlockLevelBox::OutOfFlowFloatBox(_box_) => { - // FIXME: call layout_maybe_position_relative_fragment here - Fragment::Anonymous(AnonymousFragment::no_op( - containing_block.style.writing_mode, - )) + BlockLevelBox::OutOfFlowFloatBox(box_) => { + box_.layout( + layout_context, + positioning_context, + containing_block, + sequential_layout_state, + ); + Fragment::Float }, } } @@ -425,7 +413,7 @@ fn layout_in_flow_non_replaced_block_level( style: &Arc, block_level_kind: NonReplacedContents, tree_rank: usize, - float_context: Option<&mut FloatContext>, + mut sequential_layout_state: Option<&mut SequentialLayoutState>, ) -> BoxFragment { let pbm = style.padding_border_margin(containing_block); let box_size = style.content_box_size(containing_block, &pbm); @@ -479,37 +467,76 @@ fn layout_in_flow_non_replaced_block_level( block_size, style, }; + // https://drafts.csswg.org/css-writing-modes/#orthogonal-flows assert_eq!( containing_block.style.writing_mode, containing_block_for_children.style.writing_mode, "Mixed writing modes are not supported yet" ); + let block_is_same_formatting_context = match block_level_kind { + NonReplacedContents::SameFormattingContextBlock(_) => true, + NonReplacedContents::EstablishesAnIndependentFormattingContext(_) => false, + }; + + let start_margin_can_collapse_with_children = block_is_same_formatting_context && + pbm.padding.block_start == Length::zero() && + pbm.border.block_start == Length::zero(); + 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 && + min_box_size.block == Length::zero(); + + let mut clearance = Length::zero(); + let old_inline_walls; + match sequential_layout_state { + None => old_inline_walls = None, + Some(ref mut sequential_layout_state) => { + sequential_layout_state.adjoin_assign(&CollapsedMargin::new(margin.block_start)); + if !start_margin_can_collapse_with_children { + sequential_layout_state.collapse_margins(); + } + + // Introduce clearance if necessary. + let clear_side = ClearSide::from_style(style); + clearance = sequential_layout_state.calculate_clearance(clear_side); + + // NB: This will be a no-op if we're collapsing margins with our children since that + // can only happen if we have no block-start padding and border. + sequential_layout_state.advance_block_position( + pbm.padding.block_start + pbm.border.block_start + clearance, + ); + + // Store our old inline walls so we can reset them later. + old_inline_walls = Some(sequential_layout_state.floats.walls); + sequential_layout_state.floats.walls.left += + pbm.padding.inline_start + pbm.border.inline_start + margin.inline_start; + sequential_layout_state.floats.walls.right = + sequential_layout_state.floats.walls.left + inline_size; + }, + }; + let mut block_margins_collapsed_with_children = CollapsedBlockMargins::from_margin(&margin); let fragments; let mut content_block_size; match block_level_kind { NonReplacedContents::SameFormattingContextBlock(contents) => { - let start_margin_can_collapse_with_children = pbm.padding.block_start == Length::zero() && - pbm.border.block_start == Length::zero(); - let end_margin_can_collapse_with_children = pbm.padding.block_end == Length::zero() && - pbm.border.block_end == Length::zero() && - block_size == LengthOrAuto::Auto && - min_box_size.block == Length::zero(); - let flow_layout = contents.layout( layout_context, positioning_context, &containing_block_for_children, tree_rank, - float_context, + sequential_layout_state.as_mut().map(|x| &mut **x), CollapsibleWithParentStartMargin(start_margin_can_collapse_with_children), ); + fragments = flow_layout.fragments; content_block_size = flow_layout.content_block_size; - let mut collapsible_margins_in_children = flow_layout.collapsible_margins_in_children; + // Update margins. + let mut collapsible_margins_in_children = flow_layout.collapsible_margins_in_children; if start_margin_can_collapse_with_children { block_margins_collapsed_with_children .start @@ -546,12 +573,31 @@ fn layout_in_flow_non_replaced_block_level( content_block_size = independent_layout.content_block_size; }, }; + let block_size = block_size.auto_is(|| { content_block_size.clamp_between_extremums(min_box_size.block, max_box_size.block) }); + + if let Some(ref mut sequential_layout_state) = sequential_layout_state { + // Now that we're done laying out our children, we can restore the old inline walls. + sequential_layout_state.floats.walls = old_inline_walls.unwrap(); + + // Account for padding and border. We also might have to readjust the + // `bfc_relative_block_position` if it was different from the content size (i.e. was + // non-`auto` and/or was affected by min/max block size). + sequential_layout_state.advance_block_position( + (block_size - content_block_size) + pbm.padding.block_end + pbm.border.block_end, + ); + + if !end_margin_can_collapse_with_children { + sequential_layout_state.collapse_margins(); + } + sequential_layout_state.adjoin_assign(&CollapsedMargin::new(margin.block_end)); + } + let content_rect = Rect { start_corner: Vec2 { - block: pbm.padding.block_start + pbm.border.block_start, + block: pbm.padding.block_start + pbm.border.block_start + clearance, inline: pbm.padding.inline_start + pbm.border.inline_start + margin.inline_start, }, size: Vec2 { @@ -559,6 +605,7 @@ fn layout_in_flow_non_replaced_block_level( inline: inline_size, }, }; + BoxFragment::new( base_fragment_info, style.clone(), @@ -567,6 +614,7 @@ fn layout_in_flow_non_replaced_block_level( pbm.padding, pbm.border, margin, + clearance, block_margins_collapsed_with_children, ) } @@ -579,6 +627,7 @@ fn layout_in_flow_replaced_block_level<'a>( base_fragment_info: BaseFragmentInfo, style: &Arc, replaced: &ReplacedContent, + mut sequential_layout_state: Option<&mut SequentialLayoutState>, ) -> BoxFragment { let pbm = style.padding_border_margin(containing_block); let size = replaced.used_size_as_if_inline_element(containing_block, style, None, &pbm); @@ -592,14 +641,24 @@ fn layout_in_flow_replaced_block_level<'a>( block_end: pbm.margin.block_end.auto_is(Length::zero), }; let fragments = replaced.make_fragments(style, size.clone()); + + let mut clearance = Length::zero(); + if let Some(ref mut sequential_layout_state) = sequential_layout_state { + sequential_layout_state.collapse_margins(); + clearance = sequential_layout_state.calculate_clearance(ClearSide::from_style(style)); + sequential_layout_state + .advance_block_position(pbm.border.block_sum() + pbm.padding.block_sum() + size.block); + }; + let content_rect = Rect { start_corner: Vec2 { - block: pbm.padding.block_start + pbm.border.block_start, + block: pbm.padding.block_start + pbm.border.block_start + clearance, inline: pbm.padding.inline_start + pbm.border.inline_start + margin.inline_start, }, size, }; let block_margins_collapsed_with_children = CollapsedBlockMargins::from_margin(&margin); + BoxFragment::new( base_fragment_info, style.clone(), @@ -608,6 +667,7 @@ fn layout_in_flow_replaced_block_level<'a>( pbm.padding, pbm.border, margin, + Length::zero(), block_margins_collapsed_with_children, ) } @@ -624,3 +684,81 @@ fn solve_inline_margins_for_in_flow_block_level( (LengthOrAuto::LengthPercentage(start), _) => (start, available - start), } } + +// State that we maintain when placing blocks. +// +// In parallel mode, this placement is done after all child blocks are laid out. In sequential +// mode, this is done right after each block is laid out. +pub(crate) struct PlacementState { + next_in_flow_margin_collapses_with_parent_start_margin: bool, + start_margin: CollapsedMargin, + current_margin: CollapsedMargin, + current_block_direction_position: Length, +} + +impl PlacementState { + fn new( + collapsible_with_parent_start_margin: CollapsibleWithParentStartMargin, + ) -> PlacementState { + PlacementState { + next_in_flow_margin_collapses_with_parent_start_margin: + collapsible_with_parent_start_margin.0, + start_margin: CollapsedMargin::zero(), + current_margin: CollapsedMargin::zero(), + current_block_direction_position: Length::zero(), + } + } + + fn place_fragment(&mut self, fragment: &mut Fragment) { + match fragment { + Fragment::Box(fragment) => { + let fragment_block_margins = &fragment.block_margins_collapsed_with_children; + let fragment_block_size = fragment.clearance + + fragment.padding.block_sum() + + fragment.border.block_sum() + + fragment.content_rect.size.block; + + if self.next_in_flow_margin_collapses_with_parent_start_margin { + debug_assert_eq!(self.current_margin.solve(), Length::zero()); + self.start_margin + .adjoin_assign(&fragment_block_margins.start); + if fragment_block_margins.collapsed_through { + self.start_margin.adjoin_assign(&fragment_block_margins.end); + return; + } + self.next_in_flow_margin_collapses_with_parent_start_margin = false; + } else { + self.current_margin + .adjoin_assign(&fragment_block_margins.start); + } + fragment.content_rect.start_corner.block += + self.current_margin.solve() + self.current_block_direction_position; + if fragment_block_margins.collapsed_through { + self.current_margin + .adjoin_assign(&fragment_block_margins.end); + return; + } + self.current_block_direction_position += + self.current_margin.solve() + fragment_block_size; + self.current_margin = fragment_block_margins.end; + }, + Fragment::AbsoluteOrFixedPositioned(fragment) => { + let offset = Vec2 { + block: self.current_margin.solve() + self.current_block_direction_position, + inline: Length::new(0.), + }; + fragment.borrow_mut().adjust_offsets(offset); + }, + Fragment::Anonymous(_) | Fragment::Float => {}, + _ => unreachable!(), + } + } + + fn collapsible_margins_in_children(&self) -> CollapsedBlockMargins { + CollapsedBlockMargins { + collapsed_through: self.next_in_flow_margin_collapses_with_parent_start_margin, + start: self.start_margin, + end: self.current_margin, + } + } +} diff --git a/components/layout_2020/flow/root.rs b/components/layout_2020/flow/root.rs index 5006b65a48b..446fe002bc4 100644 --- a/components/layout_2020/flow/root.rs +++ b/components/layout_2020/flow/root.rs @@ -446,6 +446,8 @@ impl FragmentTree { Fragment::Text(fragment) => fragment .rect .to_physical(fragment.parent_style.writing_mode, &containing_block), + Fragment::HoistedFloat(_) | + Fragment::Float | Fragment::AbsoluteOrFixedPositioned(_) | Fragment::Image(_) | Fragment::IFrame(_) | @@ -526,6 +528,8 @@ impl FragmentTree { Fragment::AbsoluteOrFixedPositioned(_) | Fragment::Image(_) | Fragment::IFrame(_) | + Fragment::Float | + Fragment::HoistedFloat(_) | Fragment::Anonymous(_) => return None, }; None::<()> diff --git a/components/layout_2020/fragments.rs b/components/layout_2020/fragments.rs index 4dbacf10182..f557d16db7e 100644 --- a/components/layout_2020/fragments.rs +++ b/components/layout_2020/fragments.rs @@ -26,6 +26,11 @@ use webrender_api::{FontInstanceKey, ImageKey}; #[derive(Serialize)] pub(crate) enum Fragment { Box(BoxFragment), + // The original document position of a float in the document tree. + Float, + // A float hoisted up from its original position (where a placeholder `Fragment::Float` is) to + // its containing block. + HoistedFloat(HoistedFloatFragment), Anonymous(AnonymousFragment), /// Absolute and fixed position fragments are hoisted up so that they /// are children of the BoxFragment that establishes their containing @@ -40,6 +45,13 @@ pub(crate) enum Fragment { IFrame(IFrameFragment), } +// A float hoisted up from its original position (where a placeholder `Fragment::Float` is) to its +// containing block. +#[derive(Serialize)] +pub(crate) struct HoistedFloatFragment { + pub fragment: ArcRefCell, +} + #[derive(Serialize)] pub(crate) struct BoxFragment { pub base: BaseFragment, @@ -57,6 +69,8 @@ pub(crate) struct BoxFragment { pub border: Sides, pub margin: Sides, + pub clearance: Length, + pub block_margins_collapsed_with_children: CollapsedBlockMargins, /// The scrollable overflow of this box fragment. @@ -66,6 +80,11 @@ pub(crate) struct BoxFragment { overconstrained: PhysicalSize, } +#[derive(Serialize)] +pub(crate) struct FloatFragment { + pub box_fragment: BoxFragment, +} + #[derive(Serialize)] pub(crate) struct CollapsedBlockMargins { pub collapsed_through: bool, @@ -73,7 +92,7 @@ pub(crate) struct CollapsedBlockMargins { pub end: CollapsedMargin, } -#[derive(Clone, Copy, Serialize)] +#[derive(Clone, Copy, Debug, Serialize)] pub(crate) struct CollapsedMargin { max_positive: Length, min_negative: Length, @@ -152,6 +171,8 @@ impl Fragment { pub fn offset_inline(&mut self, offset: &Length) { let position = match self { Fragment::Box(f) => &mut f.content_rect.start_corner, + Fragment::HoistedFloat(_) | + Fragment::Float | Fragment::AbsoluteOrFixedPositioned(_) => return, Fragment::Anonymous(f) => &mut f.rect.start_corner, Fragment::Text(f) => &mut f.rect.start_corner, @@ -166,10 +187,12 @@ impl Fragment { Some(match self { Fragment::Box(fragment) => &fragment.base, Fragment::Text(fragment) => &fragment.base, + Fragment::Float => return None, Fragment::AbsoluteOrFixedPositioned(_) => return None, Fragment::Anonymous(fragment) => &fragment.base, Fragment::Image(fragment) => &fragment.base, Fragment::IFrame(fragment) => &fragment.base, + Fragment::HoistedFloat(_) => return None, }) } @@ -180,6 +203,8 @@ impl Fragment { pub fn print(&self, tree: &mut PrintTree) { match self { Fragment::Box(fragment) => fragment.print(tree), + Fragment::HoistedFloat(fragment) => fragment.print(tree), + Fragment::Float => tree.add_item(format!("Float")), Fragment::AbsoluteOrFixedPositioned(_) => { tree.add_item("AbsoluteOrFixedPositioned".to_string()); }, @@ -196,7 +221,10 @@ impl Fragment { ) -> PhysicalRect { match self { Fragment::Box(fragment) => fragment.scrollable_overflow_for_parent(&containing_block), - Fragment::AbsoluteOrFixedPositioned(_) => PhysicalRect::zero(), + Fragment::HoistedFloat(fragment) => { + (*fragment.fragment.borrow()).scrollable_overflow(&containing_block) + }, + Fragment::Float | Fragment::AbsoluteOrFixedPositioned(_) => PhysicalRect::zero(), Fragment::Anonymous(fragment) => fragment.scrollable_overflow.clone(), Fragment::Text(fragment) => fragment .rect @@ -266,17 +294,16 @@ impl Fragment { } } -impl AnonymousFragment { - pub fn no_op(mode: WritingMode) -> Self { - Self { - base: BaseFragment::anonymous(), - children: vec![], - rect: Rect::zero(), - mode, - scrollable_overflow: PhysicalRect::zero(), - } +impl HoistedFloatFragment { + #[allow(dead_code)] + pub fn print(&self, tree: &mut PrintTree) { + tree.new_level(format!("HoistedFloatFragment")); + self.fragment.borrow().print(tree); + tree.end_level(); } +} +impl AnonymousFragment { pub fn new(rect: Rect, children: Vec, mode: WritingMode) -> Self { // FIXME(mrobinson, bug 25564): We should be using the containing block // here to properly convert scrollable overflow to physical geometry. @@ -325,6 +352,7 @@ impl BoxFragment { padding: Sides, border: Sides, margin: Sides, + clearance: Length, block_margins_collapsed_with_children: CollapsedBlockMargins, ) -> BoxFragment { let position = style.get_box().position; @@ -344,6 +372,7 @@ impl BoxFragment { padding, border, margin, + clearance, block_margins_collapsed_with_children, PhysicalSize::new(width_overconstrained, height_overconstrained), ) @@ -357,6 +386,7 @@ impl BoxFragment { padding: Sides, border: Sides, margin: Sides, + clearance: Length, block_margins_collapsed_with_children: CollapsedBlockMargins, overconstrained: PhysicalSize, ) -> BoxFragment { @@ -379,6 +409,7 @@ impl BoxFragment { padding, border, margin, + clearance, block_margins_collapsed_with_children, scrollable_overflow_from_children, overconstrained, diff --git a/components/layout_2020/geom.rs b/components/layout_2020/geom.rs index 7d687069d49..768f7aaf80d 100644 --- a/components/layout_2020/geom.rs +++ b/components/layout_2020/geom.rs @@ -251,6 +251,16 @@ impl flow_relative::Sides { self.block_start + self.block_end } + pub fn sum(&self) -> flow_relative::Vec2 + where + T: Add + Copy, + { + flow_relative::Vec2 { + inline: self.inline_sum(), + block: self.block_sum(), + } + } + pub fn to_physical(&self, mode: WritingMode) -> PhysicalSides where T: Clone, @@ -290,6 +300,18 @@ impl flow_relative::Sides { } } +impl flow_relative::Sides +where + T: Copy, +{ + pub fn start_offset(&self) -> flow_relative::Vec2 { + flow_relative::Vec2 { + inline: self.inline_start, + block: self.block_start, + } + } +} + impl flow_relative::Sides<&'_ LengthPercentage> { pub fn percentages_relative_to(&self, basis: Length) -> flow_relative::Sides { self.map(|s| s.percentage_relative_to(basis)) diff --git a/components/layout_2020/positioned.rs b/components/layout_2020/positioned.rs index 727fa618292..2ac43c95057 100644 --- a/components/layout_2020/positioned.rs +++ b/components/layout_2020/positioned.rs @@ -651,6 +651,7 @@ impl HoistedAbsolutelyPositionedBox { pbm.padding, pbm.border, margin, + Length::zero(), CollapsedBlockMargins::zero(), physical_overconstrained, ) @@ -793,7 +794,7 @@ fn adjust_static_positions( let child_fragment_rect = match &child_fragments[original_tree_rank] { Fragment::Box(b) => &b.content_rect, - Fragment::AbsoluteOrFixedPositioned(_) => continue, + Fragment::AbsoluteOrFixedPositioned(_) | Fragment::Float => continue, Fragment::Anonymous(a) => &a.rect, _ => unreachable!(), }; diff --git a/components/layout_2020/query.rs b/components/layout_2020/query.rs index 3fd02a1597c..a0b3ce6a41a 100644 --- a/components/layout_2020/query.rs +++ b/components/layout_2020/query.rs @@ -434,6 +434,8 @@ fn process_offset_parent_query_inner( Fragment::AbsoluteOrFixedPositioned(_) | Fragment::Image(_) | Fragment::IFrame(_) | + Fragment::Float | + Fragment::HoistedFloat(_) | Fragment::Anonymous(_) => unreachable!(), }; let border_box = fragment_relative_rect.translate(containing_block.origin.to_vector()); @@ -510,6 +512,8 @@ fn process_offset_parent_query_inner( Fragment::Text(_) | Fragment::Image(_) | Fragment::IFrame(_) | + Fragment::Float | + Fragment::HoistedFloat(_) | Fragment::Anonymous(_) => None, }; @@ -561,6 +565,8 @@ fn process_offset_parent_query_inner( Fragment::Text(_) | Fragment::Image(_) | Fragment::IFrame(_) | + Fragment::Float | + Fragment::HoistedFloat(_) | Fragment::Anonymous(_) => None, } }) diff --git a/components/layout_2020/tests/floats.rs b/components/layout_2020/tests/floats.rs index cae402ac316..affc67cdecf 100644 --- a/components/layout_2020/tests/floats.rs +++ b/components/layout_2020/tests/floats.rs @@ -9,7 +9,7 @@ extern crate lazy_static; use euclid::num::Zero; use layout::flow::float::{ClearSide, FloatBand, FloatBandNode, FloatBandTree, FloatContext}; -use layout::flow::float::{FloatSide, PlacementInfo}; +use layout::flow::float::{FloatSide, InlineWalls, PlacementInfo}; use layout::geom::flow_relative::{Rect, Vec2}; use quickcheck::{Arbitrary, Gen}; use std::f32; @@ -57,9 +57,7 @@ impl<'a> Drop for PanicMsgSuppressor<'a> { struct FloatBandWrapper(FloatBand); impl Arbitrary for FloatBandWrapper { - fn arbitrary(generator: &mut G) -> FloatBandWrapper - where - G: Gen, + fn arbitrary(generator: &mut Gen) -> FloatBandWrapper { let top: u32 = Arbitrary::arbitrary(generator); let left: Option = Arbitrary::arbitrary(generator); @@ -81,9 +79,7 @@ struct FloatRangeInput { } impl Arbitrary for FloatRangeInput { - fn arbitrary(generator: &mut G) -> FloatRangeInput - where - G: Gen, + fn arbitrary(generator: &mut Gen) -> FloatRangeInput { let start_index: u32 = Arbitrary::arbitrary(generator); let band_count: u32 = Arbitrary::arbitrary(generator); @@ -341,19 +337,20 @@ struct FloatInput { // The float may be placed no higher than this line. This simulates the effect of line boxes // per CSS 2.1 § 9.5.1 rule 6. ceiling: u32, + /// Distances from the logical left side of the block formatting context to the logical sides + /// of the current containing block. + walls: InlineWalls, } impl Arbitrary for FloatInput { - fn arbitrary(generator: &mut G) -> FloatInput - where - G: Gen, + fn arbitrary(generator: &mut Gen) -> FloatInput { let width: u32 = Arbitrary::arbitrary(generator); let height: u32 = Arbitrary::arbitrary(generator); let is_left: bool = Arbitrary::arbitrary(generator); let ceiling: u32 = Arbitrary::arbitrary(generator); - let left_wall: u32 = Arbitrary::arbitrary(generator); - let right_wall: u32 = Arbitrary::arbitrary(generator); + let left: u32 = Arbitrary::arbitrary(generator); + let right: u32 = Arbitrary::arbitrary(generator); let clear: u8 = Arbitrary::arbitrary(generator); FloatInput { info: PlacementInfo { @@ -367,10 +364,12 @@ impl Arbitrary for FloatInput { FloatSide::Right }, clear: new_clear_side(clear), - left_wall: Length::new(left_wall as f32), - right_wall: Length::new(right_wall as f32), }, ceiling, + walls: InlineWalls { + left: Length::new(left as f32), + right: Length::new(right as f32), + }, } } @@ -389,12 +388,12 @@ impl Arbitrary for FloatInput { this.info.clear = new_clear_side(clear_side); shrunk = true; } - if let Some(left_wall) = self.info.left_wall.px().shrink().next() { - this.info.left_wall = Length::new(left_wall); + if let Some(left) = self.walls.left.px().shrink().next() { + this.walls.left = Length::new(left); shrunk = true; } - if let Some(right_wall) = self.info.right_wall.px().shrink().next() { - this.info.right_wall = Length::new(right_wall); + if let Some(right) = self.walls.right.px().shrink().next() { + this.walls.right = Length::new(right); shrunk = true; } if let Some(ceiling) = self.ceiling.shrink().next() { @@ -430,6 +429,7 @@ struct PlacedFloat { origin: Vec2, info: PlacementInfo, ceiling: Length, + walls: InlineWalls, } impl Drop for FloatPlacement { @@ -442,8 +442,12 @@ impl Drop for FloatPlacement { eprintln!("Failing float placement:"); for placed_float in &self.placed_floats { eprintln!( - " * {:?} @ {:?}, {:?}", - placed_float.info, placed_float.origin, placed_float.ceiling + " * {:?} @ {:?}, T {:?} L {:?} R {:?}", + placed_float.info, + placed_float.origin, + placed_float.ceiling, + placed_float.walls.left, + placed_float.walls.right, ); } eprintln!("Bands:\n{:?}\n", self.float_context.bands); @@ -466,10 +470,12 @@ impl FloatPlacement { for float in floats { let ceiling = Length::new(float.ceiling as f32); float_context.lower_ceiling(ceiling); + float_context.walls = float.walls; placed_floats.push(PlacedFloat { origin: float_context.add_float(&float.info), info: float.info, ceiling, + walls: float.walls, }) } FloatPlacement { @@ -488,9 +494,9 @@ impl FloatPlacement { fn check_floats_rule_1(placement: &FloatPlacement) { for placed_float in &placement.placed_floats { match placed_float.info.side { - FloatSide::Left => assert!(placed_float.origin.inline >= placed_float.info.left_wall), + FloatSide::Left => assert!(placed_float.origin.inline >= placed_float.walls.left), FloatSide::Right => { - assert!(placed_float.rect().max_inline_position() <= placed_float.info.right_wall) + assert!(placed_float.rect().max_inline_position() <= placed_float.walls.right) }, } } @@ -596,12 +602,12 @@ fn check_floats_rule_7(placement: &FloatPlacement) { // Only consider floats that stick out. match placed_float.info.side { FloatSide::Left => { - if placed_float.rect().max_inline_position() <= placed_float.info.right_wall { + if placed_float.rect().max_inline_position() <= placed_float.walls.right { continue; } }, FloatSide::Right => { - if placed_float.origin.inline >= placed_float.info.left_wall { + if placed_float.origin.inline >= placed_float.walls.left { continue; } }, diff --git a/components/style/properties/longhands/box.mako.rs b/components/style/properties/longhands/box.mako.rs index 62c3da725f5..3c3532bea7a 100644 --- a/components/style/properties/longhands/box.mako.rs +++ b/components/style/properties/longhands/box.mako.rs @@ -66,8 +66,8 @@ ${helpers.predefined_type( "Float", "computed::Float::None", engines="gecko servo-2013 servo-2020", - servo_2020_pref="layout.2020.unimplemented", initial_specified_value="specified::Float::None", + servo_2020_pref="layout.floats.enabled", spec="https://drafts.csswg.org/css-box/#propdef-float", animation_value_type="discrete", servo_restyle_damage="rebuild_and_reflow", @@ -78,7 +78,8 @@ ${helpers.predefined_type( "clear", "Clear", "computed::Clear::None", - engines="gecko servo-2013", + engines="gecko servo-2013 servo-2020", + servo_2020_pref="layout.floats.enabled", animation_value_type="discrete", gecko_ffi_name="mBreakType", spec="https://drafts.csswg.org/css-box/#propdef-clear", diff --git a/components/style/values/computed/length.rs b/components/style/values/computed/length.rs index 02b42b48241..f455da5f676 100644 --- a/components/style/values/computed/length.rs +++ b/components/style/values/computed/length.rs @@ -18,7 +18,7 @@ use crate::values::{specified, CSSFloat}; use crate::Zero; use app_units::Au; use std::fmt::{self, Write}; -use std::ops::{Add, AddAssign, Div, Mul, MulAssign, Neg, Sub}; +use std::ops::{Add, AddAssign, Div, Mul, MulAssign, Neg, Sub, SubAssign}; use style_traits::{CSSPixel, CssWriter, ToCss}; pub use super::image::Image; @@ -399,6 +399,13 @@ impl Sub for CSSPixelLength { } } +impl SubAssign for CSSPixelLength { + #[inline] + fn sub_assign(&mut self, other: Self) { + self.0 -= other.0; + } +} + impl From for Au { #[inline] fn from(len: CSSPixelLength) -> Self { diff --git a/resources/prefs.json b/resources/prefs.json index f093171c6ee..1ffe6001776 100644 --- a/resources/prefs.json +++ b/resources/prefs.json @@ -100,6 +100,7 @@ "layout.animations.test.enabled": false, "layout.columns.enabled": false, "layout.flexbox.enabled": false, + "layout.floats.enabled": false, "layout.threads": 3, "layout.viewport.enabled": false, "layout.writing-mode.enabled": false, diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/__dir__.ini b/tests/wpt/metadata-layout-2020/css/CSS2/__dir__.ini new file mode 100644 index 00000000000..43a774a6216 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/__dir__.ini @@ -0,0 +1 @@ +prefs: ["layout.floats.enabled:true"] diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/css1/c414-flt-fit-006.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/css1/c414-flt-fit-006.xht.ini deleted file mode 100644 index a306acbd9b6..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/css1/c414-flt-fit-006.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[c414-flt-fit-006.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/css1/c414-flt-wrap-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/css1/c414-flt-wrap-001.xht.ini deleted file mode 100644 index b07643272b6..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/css1/c414-flt-wrap-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[c414-flt-wrap-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/css1/c5525-fltwidth-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/css1/c5525-fltwidth-001.xht.ini new file mode 100644 index 00000000000..87f64e42a64 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/css1/c5525-fltwidth-001.xht.ini @@ -0,0 +1,2 @@ +[c5525-fltwidth-001.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/adjacent-floats-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/adjacent-floats-001.xht.ini deleted file mode 100644 index 25e42ff4489..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/adjacent-floats-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[adjacent-floats-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-002.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-002.xht.ini deleted file mode 100644 index 263945fcd72..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-002.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-002.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-003.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-003.xht.ini deleted file mode 100644 index c9d70d54fc2..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-003.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-003.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-applies-to-000.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-applies-to-000.xht.ini deleted file mode 100644 index 178da45626e..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-applies-to-000.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-applies-to-000.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-applies-to-009.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-applies-to-009.xht.ini deleted file mode 100644 index 7ea0dbf7cb3..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-applies-to-009.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-applies-to-009.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-001.xht.ini deleted file mode 100644 index 0e8e0e0ee53..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-clearance-calculation-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-002.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-002.xht.ini deleted file mode 100644 index e5285972074..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-002.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-clearance-calculation-002.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-004.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-004.xht.ini deleted file mode 100644 index 6e5799fc585..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-004.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-clearance-calculation-004.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-005.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-005.xht.ini deleted file mode 100644 index 7be06937891..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-clearance-calculation-005.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-clearance-calculation-005.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-default-inheritance-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-default-inheritance-001.xht.ini deleted file mode 100644 index e6429447b76..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-default-inheritance-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-default-inheritance-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-001.xht.ini deleted file mode 100644 index 129cffa434c..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-float-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-002.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-002.xht.ini deleted file mode 100644 index c68786b2faf..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-002.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-float-002.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-004.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-004.xht.ini deleted file mode 100644 index 827fb8b043a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-004.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-float-004.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-005.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-005.xht.ini deleted file mode 100644 index 835feca1dca..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-005.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-float-005.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-006.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-006.xht.ini deleted file mode 100644 index 27f26309c4d..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-006.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-float-006.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-007.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-007.xht.ini deleted file mode 100644 index 60cb4e21a6f..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-007.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-float-007.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-008.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-008.xht.ini deleted file mode 100644 index ae6f85d2fe8..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-008.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-float-008.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-009.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-009.xht.ini deleted file mode 100644 index 89180886c24..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-float-009.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-float-009.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-initial-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-initial-001.xht.ini deleted file mode 100644 index 9bfe5f3baef..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-initial-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-initial-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-no-interpolation.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-no-interpolation.html.ini index 63d771b53d7..d1834521a82 100644 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-no-interpolation.html.ini +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-no-interpolation.html.ini @@ -1,25 +1,4 @@ [clear-no-interpolation.html] - [CSS Transitions: property from [initial\] to [both\] at (-0.3) should be [initial\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [both\] at (0) should be [initial\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [both\] at (0.3) should be [initial\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [both\] at (0.5) should be [both\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [both\] at (0.6) should be [both\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [both\] at (1) should be [both\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [both\] at (1.5) should be [both\]] - expected: FAIL - [CSS Transitions with transition: all: property from [initial\] to [both\] at (-0.3) should be [both\]] expected: FAIL @@ -29,39 +8,6 @@ [CSS Transitions with transition: all: property from [initial\] to [both\] at (0.3) should be [both\]] expected: FAIL - [CSS Transitions with transition: all: property from [initial\] to [both\] at (0.5) should be [both\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [both\] at (0.6) should be [both\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [both\] at (1) should be [both\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [both\] at (1.5) should be [both\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [both\] at (-0.3) should be [initial\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [both\] at (0) should be [initial\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [both\] at (0.3) should be [initial\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [both\] at (0.5) should be [both\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [both\] at (0.6) should be [both\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [both\] at (1) should be [both\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [both\] at (1.5) should be [both\]] - expected: FAIL - [Web Animations: property from [initial\] to [both\] at (-0.3) should be [initial\]] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-child-with-margins-2.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-child-with-margins-2.html.ini deleted file mode 100644 index bd217127549..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-child-with-margins-2.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-on-child-with-margins-2.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-parent-and-child.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-parent-and-child.html.ini deleted file mode 100644 index 415e4eb73a9..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-parent-and-child.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-on-parent-and-child.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-with-top-margin-after-cleared-empty-block.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-with-top-margin-after-cleared-empty-block.html.ini new file mode 100644 index 00000000000..c1602cdda56 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-with-top-margin-after-cleared-empty-block.html.ini @@ -0,0 +1,2 @@ +[clear-with-top-margin-after-cleared-empty-block.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clearance-006.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clearance-006.xht.ini deleted file mode 100644 index 2535d0e4f9c..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clearance-006.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clearance-006.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-001a.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-001a.xht.ini deleted file mode 100644 index f21a6c98c3a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-001a.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-applies-to-001a.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-004a.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-004a.xht.ini deleted file mode 100644 index de0c81bbade..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-004a.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-applies-to-004a.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-005.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-005.xht.ini deleted file mode 100644 index a883902a478..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-005.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-applies-to-005.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-006.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-006.xht.ini deleted file mode 100644 index 8a0aad4475a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-006.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-applies-to-006.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-007.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-007.xht.ini deleted file mode 100644 index 4deb4443f9f..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-007.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-applies-to-007.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-008.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-008.xht.ini deleted file mode 100644 index 17db21e0d48..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-008.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-applies-to-008.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-008a.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-008a.xht.ini deleted file mode 100644 index ac207eaf406..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-008a.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-applies-to-008a.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-009.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-009.xht.ini deleted file mode 100644 index 62561de0f67..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-009.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-applies-to-009.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-012.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-012.xht.ini deleted file mode 100644 index 273de32776e..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-012.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-applies-to-012.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-015.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-015.xht.ini deleted file mode 100644 index 93b007b2849..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-applies-to-015.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-applies-to-015.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-height-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-height-001.xht.ini deleted file mode 100644 index 86a252266e8..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-height-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-non-replaced-height-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-001.xht.ini deleted file mode 100644 index 2a53227a5da..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-non-replaced-width-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-003.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-003.xht.ini deleted file mode 100644 index 5aae804edb7..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-003.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-non-replaced-width-003.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-004.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-004.xht.ini deleted file mode 100644 index ba7944663aa..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-004.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-non-replaced-width-004.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-005.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-005.xht.ini deleted file mode 100644 index 7b141145aec..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-non-replaced-width-005.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-non-replaced-width-005.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-height-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-height-001.xht.ini new file mode 100644 index 00000000000..a04702deda6 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-height-001.xht.ini @@ -0,0 +1,2 @@ +[float-replaced-height-001.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-003.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-003.xht.ini deleted file mode 100644 index 00a2629e480..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-003.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-replaced-width-003.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-004.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-004.xht.ini deleted file mode 100644 index 3cd20e6c979..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-004.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-replaced-width-004.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-006.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-006.xht.ini deleted file mode 100644 index f7a953c673c..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-006.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-replaced-width-006.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-011.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-011.xht.ini deleted file mode 100644 index bf876293d1c..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-replaced-width-011.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-replaced-width-011.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-001.xht.ini deleted file mode 100644 index d8f17a07194..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-002.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-002.xht.ini deleted file mode 100644 index 6c0961e88f6..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-002.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-002.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-003.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-003.xht.ini deleted file mode 100644 index 4ea240af765..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-003.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-003.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-004.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-004.xht.ini deleted file mode 100644 index b1d5785a3d3..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-004.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-004.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-007.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-007.xht.ini deleted file mode 100644 index c8d3156abcb..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-007.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-007.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-008.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-008.xht.ini deleted file mode 100644 index b4997d88ab0..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-008.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-008.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-009.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-009.xht.ini deleted file mode 100644 index cefc075835d..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-009.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-009.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-023.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-023.xht.ini deleted file mode 100644 index d2970edef2e..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-023.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-023.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-024.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-024.xht.ini deleted file mode 100644 index a35e3d8c551..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-024.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-024.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-025.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-025.xht.ini deleted file mode 100644 index d31574fc40a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-025.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-025.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-028.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-028.xht.ini deleted file mode 100644 index de3e7f49b02..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-028.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-028.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-041.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-041.xht.ini deleted file mode 100644 index b21db4dcaa7..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-041.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-041.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-043.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-043.xht.ini deleted file mode 100644 index d53c0472c86..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-043.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-043.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-119.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-119.xht.ini deleted file mode 100644 index 59e958ba061..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-119.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-119.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-120.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-120.xht.ini deleted file mode 100644 index ffa3032e124..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-120.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-120.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-121.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-121.xht.ini deleted file mode 100644 index a446bc1d86e..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-121.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-121.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-123.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-123.xht.ini deleted file mode 100644 index d8a11c28602..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-123.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-123.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-005.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-132.xht.ini similarity index 50% rename from tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-005.xht.ini rename to tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-132.xht.ini index 00b1a83c511..981a921e1e3 100644 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/float-005.xht.ini +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-132.xht.ini @@ -1,2 +1,2 @@ -[float-005.xht] +[floats-132.xht] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-135.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-135.xht.ini deleted file mode 100644 index 13e9f34b789..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-135.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-135.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-004.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-139.xht.ini similarity index 50% rename from tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-004.xht.ini rename to tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-139.xht.ini index 363f550fa3b..326d5e0545f 100644 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-004.xht.ini +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-139.xht.ini @@ -1,2 +1,2 @@ -[clear-004.xht] +[floats-139.xht] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-141.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-141.xht.ini deleted file mode 100644 index 0ad11b3c5cb..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-141.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-141.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-144.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-144.xht.ini deleted file mode 100644 index d41b1141704..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-144.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-144.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-146.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-146.xht.ini deleted file mode 100644 index 447aaf2c7f1..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-146.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-146.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-147.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-147.xht.ini deleted file mode 100644 index fc980a2963e..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-147.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-147.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-154.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-154.xht.ini deleted file mode 100644 index b79217cfa4c..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-154.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-154.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-bfc-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-bfc-001.xht.ini new file mode 100644 index 00000000000..fe8adde8fbd --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-bfc-001.xht.ini @@ -0,0 +1,2 @@ +[floats-bfc-001.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-002.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-002.html.ini deleted file mode 100644 index e2c2ea977c9..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-002.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-clear-multicol-002.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-003.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-003.html.ini deleted file mode 100644 index 35dfeadcc27..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-003.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-clear-multicol-003.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-balancing-002.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-balancing-002.html.ini deleted file mode 100644 index 2cf5b77669a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-balancing-002.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-clear-multicol-balancing-002.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-balancing-003.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-balancing-003.html.ini deleted file mode 100644 index f9262541fde..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/floats-clear-multicol-balancing-003.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-clear-multicol-balancing-003.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-018.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-018.xht.ini new file mode 100644 index 00000000000..27f65ceefa2 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-018.xht.ini @@ -0,0 +1,2 @@ +[margin-collapse-018.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-023.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-023.xht.ini deleted file mode 100644 index 7ab6857b82e..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-023.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-collapse-023.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-027.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-027.xht.ini new file mode 100644 index 00000000000..519aa8a80eb --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-027.xht.ini @@ -0,0 +1,2 @@ +[margin-collapse-027.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-165.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-165.xht.ini deleted file mode 100644 index 4591f167f7e..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-165.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-collapse-165.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-166.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-166.xht.ini deleted file mode 100644 index 65dcb5d674c..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/margin-collapse-166.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-collapse-166.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/no-clearance-due-to-large-margin-after-left-right.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/no-clearance-due-to-large-margin-after-left-right.html.ini deleted file mode 100644 index d4a609c9975..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/no-clearance-due-to-large-margin-after-left-right.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[no-clearance-due-to-large-margin-after-left-right.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/second-float-inside-empty-cleared-block-after-margin.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/second-float-inside-empty-cleared-block-after-margin.html.ini deleted file mode 100644 index 6ad7741c4ee..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/second-float-inside-empty-cleared-block-after-margin.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[second-float-inside-empty-cleared-block-after-margin.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/second-float-inside-empty-cleared-block.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/second-float-inside-empty-cleared-block.html.ini deleted file mode 100644 index 7797a77875a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/second-float-inside-empty-cleared-block.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[second-float-inside-empty-cleared-block.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/computed-float-position-absolute.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/computed-float-position-absolute.html.ini deleted file mode 100644 index 89b04db1041..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/computed-float-position-absolute.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[computed-float-position-absolute.html] - [The computed value of float with absolute positioning when there is no box should be "none"] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-no-interpolation.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-no-interpolation.html.ini index e22dbec9c1d..d731172896e 100644 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-no-interpolation.html.ini +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-no-interpolation.html.ini @@ -1,25 +1,4 @@ [float-no-interpolation.html] - [CSS Transitions: property from [initial\] to [right\] at (-0.3) should be [initial\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [right\] at (0) should be [initial\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [right\] at (0.3) should be [initial\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [right\] at (0.5) should be [right\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [right\] at (0.6) should be [right\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [right\] at (1) should be [right\]] - expected: FAIL - - [CSS Transitions: property from [initial\] to [right\] at (1.5) should be [right\]] - expected: FAIL - [CSS Transitions with transition: all: property from [initial\] to [right\] at (-0.3) should be [right\]] expected: FAIL @@ -29,27 +8,6 @@ [CSS Transitions with transition: all: property from [initial\] to [right\] at (0.3) should be [right\]] expected: FAIL - [CSS Transitions with transition: all: property from [initial\] to [right\] at (0.5) should be [right\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [right\] at (0.6) should be [right\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [right\] at (1) should be [right\]] - expected: FAIL - - [CSS Transitions with transition: all: property from [initial\] to [right\] at (1.5) should be [right\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [right\] at (-0.3) should be [initial\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [right\] at (0) should be [initial\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [right\] at (0.3) should be [initial\]] - expected: FAIL - [CSS Animations: property from [initial\] to [right\] at (0.5) should be [right\]] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-1.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-1.html.ini deleted file mode 100644 index fb33bc321dd..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-1.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-nowrap-1.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-3-ref.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-3-ref.html.ini deleted file mode 100644 index 6d647b8e949..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-3-ref.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-nowrap-3-ref.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-4.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-4.html.ini new file mode 100644 index 00000000000..5ccf375acb2 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-4.html.ini @@ -0,0 +1,2 @@ +[float-nowrap-4.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-6.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-6.html.ini new file mode 100644 index 00000000000..7b863cf49e6 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-nowrap-6.html.ini @@ -0,0 +1,2 @@ +[float-nowrap-6.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-root.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-root.html.ini new file mode 100644 index 00000000000..8bb5b681b05 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-root.html.ini @@ -0,0 +1,2 @@ +[float-root.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-table-align-left-quirk.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-table-align-left-quirk.html.ini new file mode 100644 index 00000000000..700de2902b4 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-table-align-left-quirk.html.ini @@ -0,0 +1,2 @@ +[float-table-align-left-quirk.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-under-flatten-under-preserve-3d.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-under-flatten-under-preserve-3d.html.ini new file mode 100644 index 00000000000..34417d4fee3 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-under-flatten-under-preserve-3d.html.ini @@ -0,0 +1,2 @@ +[float-under-flatten-under-preserve-3d.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-in-table-caption-001.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-in-table-caption-001.html.ini new file mode 100644 index 00000000000..86715ffc9c2 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-in-table-caption-001.html.ini @@ -0,0 +1,2 @@ +[floats-in-table-caption-001.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-004.html.ini new file mode 100644 index 00000000000..a7de7bbf707 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-004.html.ini @@ -0,0 +1,2 @@ +[floats-placement-004.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-006.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-006.html.ini deleted file mode 100644 index a57179657f7..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-006.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-placement-006.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001a.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001a.xht.ini new file mode 100644 index 00000000000..b0c8a8783e5 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001a.xht.ini @@ -0,0 +1,2 @@ +[floats-placement-vertical-001a.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001b.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001b.xht.ini new file mode 100644 index 00000000000..bd706c1a2cb --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001b.xht.ini @@ -0,0 +1,2 @@ +[floats-placement-vertical-001b.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001c.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001c.xht.ini new file mode 100644 index 00000000000..ef7c5a18c80 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-001c.xht.ini @@ -0,0 +1,2 @@ +[floats-placement-vertical-001c.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-003.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-003.xht.ini new file mode 100644 index 00000000000..6b7cb570a8a --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-placement-vertical-003.xht.ini @@ -0,0 +1,2 @@ +[floats-placement-vertical-003.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-rule3-outside-left-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-rule3-outside-left-001.xht.ini deleted file mode 100644 index f919d0205c5..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-rule3-outside-left-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-rule3-outside-left-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-rule3-outside-right-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-rule3-outside-right-001.xht.ini deleted file mode 100644 index fdbae1835ea..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-rule3-outside-right-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-rule3-outside-right-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-outside-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-outside-001.xht.ini deleted file mode 100644 index 4b1faaafa76..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-outside-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-bfc-outside-001.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-with-margin-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-with-margin-004.html.ini new file mode 100644 index 00000000000..01db57e6795 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-with-margin-004.html.ini @@ -0,0 +1,2 @@ +[floats-wrap-bfc-with-margin-004.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-with-margin-005.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-with-margin-005.html.ini new file mode 100644 index 00000000000..9b3070b4f24 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/floats-wrap-bfc-with-margin-005.html.ini @@ -0,0 +1,2 @@ +[floats-wrap-bfc-with-margin-005.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-001.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-001.html.ini new file mode 100644 index 00000000000..0842d0b5727 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-001.html.ini @@ -0,0 +1,3 @@ +[hit-test-floats-001.html] + [hit-test-floats-001] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini deleted file mode 100644 index 968f62a2553..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[hit-test-floats-002.html] - [Hit test float] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini new file mode 100644 index 00000000000..13bd6abf376 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini @@ -0,0 +1,3 @@ +[hit-test-floats-004.html] + [Miss float below something else] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini new file mode 100644 index 00000000000..147f062e548 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini @@ -0,0 +1,3 @@ +[hit-test-floats-005.html] + [Miss clipped float] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/negative-margin-float-positioning.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/negative-margin-float-positioning.html.ini deleted file mode 100644 index fdf1350fbbf..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/negative-margin-float-positioning.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[negative-margin-float-positioning.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-separates-from-float.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-separates-from-float.html.ini deleted file mode 100644 index 75f0028b81a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-separates-from-float.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[new-fc-separates-from-float.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-space-between-floats-003.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-space-between-floats-003.html.ini deleted file mode 100644 index a89593d4655..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-space-between-floats-003.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[zero-space-between-floats-003.html] - [#container 1] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-space-between-floats-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-space-between-floats-004.html.ini deleted file mode 100644 index 94dca9dcbce..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-space-between-floats-004.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[zero-space-between-floats-004.html] - [#container 1] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-width-floats.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-width-floats.html.ini deleted file mode 100644 index e20b1a193ff..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/zero-width-floats.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[zero-width-floats.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini index b85cf0ffe88..ecd4976bf3a 100644 --- a/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini +++ b/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini @@ -1,4 +1,16 @@ [inline-negative-margin-001.html] + [[data-expected-height\] 3] + expected: FAIL + + [[data-expected-height\] 4] + expected: FAIL + + [[data-expected-height\] 5] + expected: FAIL + + [[data-expected-height\] 6] + expected: FAIL + [[data-expected-height\] 7] expected: FAIL @@ -19,3 +31,18 @@ [[data-expected-height\] 13] expected: FAIL + + [[data-expected-height\] 9] + expected: FAIL + + [[data-expected-height\] 10] + expected: FAIL + + [[data-expected-height\] 11] + expected: FAIL + + [[data-expected-height\] 12] + expected: FAIL + + [[data-expected-height\] 13] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/linebox/line-height-128.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/linebox/line-height-128.xht.ini deleted file mode 100644 index 29d228868d7..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/linebox/line-height-128.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[line-height-128.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-collapse-006.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-collapse-006.xht.ini deleted file mode 100644 index 3706bb99942..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-collapse-006.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-collapse-006.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-collapse-007.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-collapse-007.xht.ini deleted file mode 100644 index 3422b2ee707..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-collapse-007.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-collapse-007.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-004.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-004.xht.ini deleted file mode 100644 index 7a1e53412a9..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-004.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-004.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-005.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-005.xht.ini deleted file mode 100644 index 8069814c4e3..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-005.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-005.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-006.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-006.xht.ini deleted file mode 100644 index 6df5258dc80..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-006.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-006.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-007.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-007.xht.ini deleted file mode 100644 index 92df59a061f..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-007.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-007.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-016.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-016.xht.ini deleted file mode 100644 index 07370bc8140..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-016.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-016.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-017.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-017.xht.ini deleted file mode 100644 index 379749f53e1..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-017.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-017.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-018.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-018.xht.ini deleted file mode 100644 index 8f2fed4551a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-018.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-018.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-028.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-028.xht.ini deleted file mode 100644 index 45dca77c9d1..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-028.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-028.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-029.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-029.xht.ini deleted file mode 100644 index 2f20b359ea7..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-029.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-029.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-030.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-030.xht.ini deleted file mode 100644 index 340780bd716..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-030.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-030.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-040.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-040.xht.ini deleted file mode 100644 index 546e4d196b2..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-040.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-040.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-041.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-041.xht.ini deleted file mode 100644 index cf179026181..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-041.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-041.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-042.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-042.xht.ini deleted file mode 100644 index 1a92ab4c601..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-042.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-042.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-052.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-052.xht.ini deleted file mode 100644 index 8e2d7de69db..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-052.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-052.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-053.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-053.xht.ini deleted file mode 100644 index f782dac7f59..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-053.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-053.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-054.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-054.xht.ini deleted file mode 100644 index a5f6b22cbd6..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-054.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-054.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-064.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-064.xht.ini deleted file mode 100644 index 11fb5cf3d6f..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-064.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-064.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-065.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-065.xht.ini deleted file mode 100644 index e03ce9bbdfd..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-065.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-065.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-066.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-066.xht.ini deleted file mode 100644 index 53aae08ae86..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-066.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-066.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-076.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-076.xht.ini deleted file mode 100644 index 84a97c682f8..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-076.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-076.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-077.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-077.xht.ini deleted file mode 100644 index b6c3eeed513..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-077.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-077.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-078.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-078.xht.ini deleted file mode 100644 index e3627308d32..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-078.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-078.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-088.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-088.xht.ini deleted file mode 100644 index 529bbd42d35..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-088.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-088.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-089.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-089.xht.ini deleted file mode 100644 index ee7a9e5f88b..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-089.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-089.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-090.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-090.xht.ini deleted file mode 100644 index 5d344138fef..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-090.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-090.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-109.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-109.xht.ini deleted file mode 100644 index c814c13837d..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-109.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-109.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-110.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-110.xht.ini deleted file mode 100644 index 997363df3bc..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-110.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-110.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-111.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-111.xht.ini deleted file mode 100644 index 4730c3a161c..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-111.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-111.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-112.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-112.xht.ini deleted file mode 100644 index ab10c5fef78..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-112.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-112.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-009.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-009.xht.ini deleted file mode 100644 index ed820db11cd..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-009.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-applies-to-009.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-012.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-012.xht.ini deleted file mode 100644 index b98b4c70413..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-012.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-applies-to-012.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-013.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-013.xht.ini deleted file mode 100644 index 95164bb539e..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-013.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-applies-to-013.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-014.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-014.xht.ini deleted file mode 100644 index a7503323a33..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-014.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-applies-to-014.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-015.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-015.xht.ini deleted file mode 100644 index d16a888aadc..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/margin-right-applies-to-015.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-right-applies-to-015.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-009.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-009.xht.ini deleted file mode 100644 index 01df4e1b273..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-009.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[padding-right-applies-to-009.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-013.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-013.xht.ini deleted file mode 100644 index 6ec4984e6ad..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-013.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[padding-right-applies-to-013.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-014.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-014.xht.ini deleted file mode 100644 index 5934a3c1d25..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/margin-padding-clear/padding-right-applies-to-014.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[padding-right-applies-to-014.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-context-height-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-context-height-001.xht.ini new file mode 100644 index 00000000000..6efb0c8c2c6 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-context-height-001.xht.ini @@ -0,0 +1,2 @@ +[block-formatting-context-height-001.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-context-height-002.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-context-height-002.xht.ini new file mode 100644 index 00000000000..78396ee399c --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-context-height-002.xht.ini @@ -0,0 +1,2 @@ +[block-formatting-context-height-002.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-contexts-008.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-contexts-008.xht.ini deleted file mode 100644 index a76ac3c0bff..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-contexts-008.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block-formatting-contexts-008.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-contexts-016.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-contexts-016.xht.ini deleted file mode 100644 index 5ec72be121c..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-formatting-contexts-016.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block-formatting-contexts-016.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-001.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-001.html.ini new file mode 100644 index 00000000000..585f7f61434 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-001.html.ini @@ -0,0 +1,3 @@ +[block-in-inline-hittest-float-001.html] + [block-in-inline-hittest-float-001] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-margins-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-margins-004.html.ini new file mode 100644 index 00000000000..c951562bd42 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-margins-004.html.ini @@ -0,0 +1,2 @@ +[block-in-inline-margins-004.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-non-replaced-height-011.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-non-replaced-height-011.xht.ini deleted file mode 100644 index 9a6c179052f..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-non-replaced-height-011.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block-non-replaced-height-011.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/margin-collapse-through-percentage-padding.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/margin-collapse-through-percentage-padding.html.ini deleted file mode 100644 index 5100ee5c5a1..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/margin-collapse-through-percentage-padding.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[margin-collapse-through-percentage-padding.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/max-width-110.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/max-width-110.xht.ini deleted file mode 100644 index fe45cea6bd3..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/max-width-110.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[max-width-110.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/min-height-106.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/min-height-106.xht.ini new file mode 100644 index 00000000000..bed0c772d23 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/min-height-106.xht.ini @@ -0,0 +1,2 @@ +[min-height-106.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/width-non-replaced-inline-001.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/width-non-replaced-inline-001.xht.ini new file mode 100644 index 00000000000..4890f7308ad --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/width-non-replaced-inline-001.xht.ini @@ -0,0 +1,2 @@ +[width-non-replaced-inline-001.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/abspos-028.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/positioning/abspos-028.xht.ini deleted file mode 100644 index 904d7e5379c..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/abspos-028.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[abspos-028.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/line-break-after-leading-float.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/positioning/line-break-after-leading-float.html.ini deleted file mode 100644 index b4455bd8387..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/line-break-after-leading-float.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[line-break-after-leading-float.html] - [Checks line wrapping after leading floating objects.] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/position-relative-018.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/positioning/position-relative-018.xht.ini deleted file mode 100644 index c6ad434264c..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/position-relative-018.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[position-relative-018.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/positioning-float-002.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/positioning/positioning-float-002.xht.ini deleted file mode 100644 index 1fa701e8c6d..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/positioning/positioning-float-002.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[positioning-float-002.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/values/units-005.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/values/units-005.xht.ini deleted file mode 100644 index d1604bb0585..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/values/units-005.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[units-005.xht] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/zindex/stack-floats-003.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/zindex/stack-floats-003.xht.ini new file mode 100644 index 00000000000..1eb716de2a9 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/zindex/stack-floats-003.xht.ini @@ -0,0 +1,2 @@ +[stack-floats-003.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/zindex/stack-floats-004.xht.ini b/tests/wpt/metadata-layout-2020/css/CSS2/zindex/stack-floats-004.xht.ini new file mode 100644 index 00000000000..0e8029cf3cb --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/zindex/stack-floats-004.xht.ini @@ -0,0 +1,2 @@ +[stack-floats-004.xht] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-content/element-replacement-on-replaced-element.tentative.html.ini b/tests/wpt/metadata-layout-2020/css/css-content/element-replacement-on-replaced-element.tentative.html.ini index 2f5ce8f80b3..7bd1c2d4164 100644 --- a/tests/wpt/metadata-layout-2020/css/css-content/element-replacement-on-replaced-element.tentative.html.ini +++ b/tests/wpt/metadata-layout-2020/css/css-content/element-replacement-on-replaced-element.tentative.html.ini @@ -1,3 +1,2 @@ [element-replacement-on-replaced-element.tentative.html] - expected: - if os == "linux": FAIL + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/__dir__.ini b/tests/wpt/mozilla/meta-layout-2020/css/__dir__.ini new file mode 100644 index 00000000000..43a774a6216 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/__dir__.ini @@ -0,0 +1 @@ +prefs: ["layout.floats.enabled:true"] diff --git a/tests/wpt/mozilla/meta-layout-2020/css/abs_float_pref_width.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/abs_float_pref_width.html.ini deleted file mode 100644 index c6455058c8c..00000000000 --- a/tests/wpt/mozilla/meta-layout-2020/css/abs_float_pref_width.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[abs_float_pref_width.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/background_position_shorthand.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/background_position_shorthand.html.ini new file mode 100644 index 00000000000..032c59f959f --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/background_position_shorthand.html.ini @@ -0,0 +1,2 @@ +[background_position_shorthand.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_a.html.ini new file mode 100644 index 00000000000..766e4b3cd9d --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_a.html.ini @@ -0,0 +1,2 @@ +[block_formatting_context_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_cleared_float_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_cleared_float_a.html.ini new file mode 100644 index 00000000000..6248b681b95 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_cleared_float_a.html.ini @@ -0,0 +1,2 @@ +[block_formatting_context_cleared_float_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_complex_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_complex_a.html.ini new file mode 100644 index 00000000000..5498e467c6e --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_complex_a.html.ini @@ -0,0 +1,2 @@ +[block_formatting_context_complex_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_containing_floats_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_containing_floats_a.html.ini new file mode 100644 index 00000000000..433da844606 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_containing_floats_a.html.ini @@ -0,0 +1,2 @@ +[block_formatting_context_containing_floats_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_float_inorder_interaction_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_float_inorder_interaction_a.html.ini new file mode 100644 index 00000000000..d4170437ae9 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_float_inorder_interaction_a.html.ini @@ -0,0 +1,2 @@ +[block_formatting_context_float_inorder_interaction_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_float_placement_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_float_placement_a.html.ini new file mode 100644 index 00000000000..21e5b2e4fb5 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_float_placement_a.html.ini @@ -0,0 +1,2 @@ +[block_formatting_context_float_placement_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_margin_inout_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_margin_inout_a.html.ini deleted file mode 100644 index 7bb6c05416f..00000000000 --- a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_margin_inout_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block_formatting_context_margin_inout_a.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_max_width_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_max_width_a.html.ini deleted file mode 100644 index 72df7976703..00000000000 --- a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_max_width_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block_formatting_context_max_width_a.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_relative_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_relative_a.html.ini new file mode 100644 index 00000000000..27d6a36d72e --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_relative_a.html.ini @@ -0,0 +1,2 @@ +[block_formatting_context_relative_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_translation_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_translation_a.html.ini new file mode 100644 index 00000000000..787730d24d0 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/block_formatting_context_translation_a.html.ini @@ -0,0 +1,2 @@ +[block_formatting_context_translation_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/box_sizing_sanity_check_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/box_sizing_sanity_check_a.html.ini new file mode 100644 index 00000000000..4b2eb3c32dc --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/box_sizing_sanity_check_a.html.ini @@ -0,0 +1,2 @@ +[box_sizing_sanity_check_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/clear_generated_content_table_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/clear_generated_content_table_a.html.ini new file mode 100644 index 00000000000..c1692bba6b2 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/clear_generated_content_table_a.html.ini @@ -0,0 +1,2 @@ +[clear_generated_content_table_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/first_child_pseudo_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/first_child_pseudo_a.html.ini new file mode 100644 index 00000000000..d3a6e42c59e --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/first_child_pseudo_a.html.ini @@ -0,0 +1,2 @@ +[first_child_pseudo_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/first_of_type_pseudo_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/first_of_type_pseudo_a.html.ini new file mode 100644 index 00000000000..a00dc9daf30 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/first_of_type_pseudo_a.html.ini @@ -0,0 +1,2 @@ +[first_of_type_pseudo_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/fixed_width_overrides_child_intrinsic_width_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/fixed_width_overrides_child_intrinsic_width_a.html.ini new file mode 100644 index 00000000000..85e60ef47e5 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/fixed_width_overrides_child_intrinsic_width_a.html.ini @@ -0,0 +1,2 @@ +[fixed_width_overrides_child_intrinsic_width_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/float-abspos.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/float-abspos.html.ini deleted file mode 100644 index 6481296787a..00000000000 --- a/tests/wpt/mozilla/meta-layout-2020/css/float-abspos.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[float-abspos.html] - [A positioned element's float value computes to none] - expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/float_clearance_intrinsic_width_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/float_clearance_intrinsic_width_a.html.ini new file mode 100644 index 00000000000..f8d91241d5a --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/float_clearance_intrinsic_width_a.html.ini @@ -0,0 +1,2 @@ +[float_clearance_intrinsic_width_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/float_cleared_with_just_height.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/float_cleared_with_just_height.html.ini deleted file mode 100644 index f3653948489..00000000000 --- a/tests/wpt/mozilla/meta-layout-2020/css/float_cleared_with_just_height.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float_cleared_with_just_height.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/float_intrinsic_height.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/float_intrinsic_height.html.ini new file mode 100644 index 00000000000..195358c73b4 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/float_intrinsic_height.html.ini @@ -0,0 +1,2 @@ +[float_intrinsic_height.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/float_relative_to_position.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/float_relative_to_position.html.ini deleted file mode 100644 index ccb4cd7daaf..00000000000 --- a/tests/wpt/mozilla/meta-layout-2020/css/float_relative_to_position.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[float_relative_to_position.html] - [Tests the relationship between float and position] - expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/float_under_top_margin_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/float_under_top_margin_a.html.ini new file mode 100644 index 00000000000..4ff77391b71 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/float_under_top_margin_a.html.ini @@ -0,0 +1,2 @@ +[float_under_top_margin_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/floated_list_item_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/floated_list_item_a.html.ini new file mode 100644 index 00000000000..0b72c548d71 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/floated_list_item_a.html.ini @@ -0,0 +1,2 @@ +[floated_list_item_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/floated_negative_margins_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/floated_negative_margins_a.html.ini new file mode 100644 index 00000000000..318e3cca6ea --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/floated_negative_margins_a.html.ini @@ -0,0 +1,2 @@ +[floated_negative_margins_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/floated_table_with_margin_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/floated_table_with_margin_a.html.ini new file mode 100644 index 00000000000..06ce4557c80 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/floated_table_with_margin_a.html.ini @@ -0,0 +1,2 @@ +[floated_table_with_margin_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/floats_margin_collapse_with_clearance_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/floats_margin_collapse_with_clearance_a.html.ini deleted file mode 100644 index ce0ab0b1ec1..00000000000 --- a/tests/wpt/mozilla/meta-layout-2020/css/floats_margin_collapse_with_clearance_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats_margin_collapse_with_clearance_a.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/floats_percentage_width_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/floats_percentage_width_a.html.ini new file mode 100644 index 00000000000..9822997db62 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/floats_percentage_width_a.html.ini @@ -0,0 +1,2 @@ +[floats_percentage_width_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/incremental_float_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/incremental_float_a.html.ini new file mode 100644 index 00000000000..49abdc5cab9 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/incremental_float_a.html.ini @@ -0,0 +1,2 @@ +[incremental_float_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/input_alignment_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/input_alignment_a.html.ini deleted file mode 100644 index 0e2cd2e610f..00000000000 --- a/tests/wpt/mozilla/meta-layout-2020/css/input_alignment_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[input_alignment_a.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/intrinsic_border_box.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/intrinsic_border_box.html.ini new file mode 100644 index 00000000000..fc40b2cc92b --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/intrinsic_border_box.html.ini @@ -0,0 +1,2 @@ +[intrinsic_border_box.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/last_child_pseudo_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/last_child_pseudo_a.html.ini new file mode 100644 index 00000000000..58734a20997 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/last_child_pseudo_a.html.ini @@ -0,0 +1,2 @@ +[last_child_pseudo_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/last_of_type_pseudo_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/last_of_type_pseudo_a.html.ini new file mode 100644 index 00000000000..b96002a4a13 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/last_of_type_pseudo_a.html.ini @@ -0,0 +1,2 @@ +[last_of_type_pseudo_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/negative_margin_uncle_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/negative_margin_uncle_a.html.ini new file mode 100644 index 00000000000..2e06085fa09 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/negative_margin_uncle_a.html.ini @@ -0,0 +1,2 @@ +[negative_margin_uncle_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/nth_child_pseudo_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/nth_child_pseudo_a.html.ini new file mode 100644 index 00000000000..1c7622d3563 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/nth_child_pseudo_a.html.ini @@ -0,0 +1,2 @@ +[nth_child_pseudo_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/nth_last_child_pseudo_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/nth_last_child_pseudo_a.html.ini new file mode 100644 index 00000000000..56966cd3d78 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/nth_last_child_pseudo_a.html.ini @@ -0,0 +1,2 @@ +[nth_last_child_pseudo_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/nth_last_of_type_pseudo_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/nth_last_of_type_pseudo_a.html.ini new file mode 100644 index 00000000000..94178c8d4d1 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/nth_last_of_type_pseudo_a.html.ini @@ -0,0 +1,2 @@ +[nth_last_of_type_pseudo_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/nth_of_type_pseudo_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/nth_of_type_pseudo_a.html.ini new file mode 100644 index 00000000000..f8216f754f9 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/nth_of_type_pseudo_a.html.ini @@ -0,0 +1,2 @@ +[nth_of_type_pseudo_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/only_child_pseudo_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/only_child_pseudo_a.html.ini new file mode 100644 index 00000000000..5d9266f67b9 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/only_child_pseudo_a.html.ini @@ -0,0 +1,2 @@ +[only_child_pseudo_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/only_of_type_pseudo_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/only_of_type_pseudo_a.html.ini new file mode 100644 index 00000000000..8a6734a8266 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/only_of_type_pseudo_a.html.ini @@ -0,0 +1,2 @@ +[only_of_type_pseudo_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/percentage_height_float_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/percentage_height_float_a.html.ini new file mode 100644 index 00000000000..81adaf011d0 --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/percentage_height_float_a.html.ini @@ -0,0 +1,2 @@ +[percentage_height_float_a.html] + expected: FAIL diff --git a/tests/wpt/mozilla/meta-layout-2020/css/table_float_translation_a.html.ini b/tests/wpt/mozilla/meta-layout-2020/css/table_float_translation_a.html.ini new file mode 100644 index 00000000000..dfe4ec5cf4d --- /dev/null +++ b/tests/wpt/mozilla/meta-layout-2020/css/table_float_translation_a.html.ini @@ -0,0 +1,2 @@ +[table_float_translation_a.html] + expected: FAIL From 25f6cc04a2fe0686c5c318800211c5c5f11aaa66 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Thu, 25 May 2023 13:12:22 +0200 Subject: [PATCH 2/3] Do not hoist floated fragments Instead of hoisting floated fragments to be siblings of the fragment created by their containing block formatting context, keep them in "normal" fragment tree position and adjust their positioning to be relative to the containing block. This means that float fragments follow the existing invariants of the fragment tree and properly handle hit testing, painting order, and relative positioning. The tradeoff here is more complexity tracking the containing block offsets from the block formatting context (including handling collapsed margins), but less complexity dealing with hoisting / shared ownership in addition to the correctness benefits. Some tests are failing now because this change revealed some additional shortcomings with clearing block formatting context content size past the end of their contained floats. This will be fixed in a followup change. Co-authored-by: Oriol Brufau --- components/layout_2020/display_list/mod.rs | 4 +- .../display_list/stacking_context.rs | 29 +-- components/layout_2020/flow/float.rs | 192 ++++++++---------- components/layout_2020/flow/inline.rs | 22 +- components/layout_2020/flow/mod.rs | 116 ++++++++--- components/layout_2020/flow/root.rs | 8 +- components/layout_2020/fragments.rs | 58 ++---- components/layout_2020/positioned.rs | 2 +- components/layout_2020/query.rs | 43 ++-- components/layout_2020/tests/floats.rs | 21 +- .../clear-on-child-with-margins-2.html.ini | 2 + ...collapsing-sibling-with-clearance.html.ini | 2 + .../floats/float-no-interpolation.html.ini | 12 -- .../css/CSS2/floats/float-root.html.ini | 2 +- ...t-under-flatten-under-preserve-3d.html.ini | 2 - .../CSS2/floats/hit-test-floats-001.html.ini | 3 - .../CSS2/floats/hit-test-floats-004.html.ini | 3 - .../CSS2/floats/hit-test-floats-005.html.ini | 3 - .../new-fc-beside-adjoining-float.html.ini | 2 - .../new-fc-separates-from-float.html.ini | 2 + ...block-in-inline-hittest-float-001.html.ini | 3 - ...block-in-inline-hittest-float-002.html.ini | 15 -- 22 files changed, 250 insertions(+), 296 deletions(-) create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-child-with-margins-2.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/remove-block-before-self-collapsing-sibling-with-clearance.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/float-under-flatten-under-preserve-3d.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-001.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-beside-adjoining-float.html.ini create mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-separates-from-float.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-001.html.ini delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-002.html.ini diff --git a/components/layout_2020/display_list/mod.rs b/components/layout_2020/display_list/mod.rs index 1c1990b739d..b1201e26add 100644 --- a/components/layout_2020/display_list/mod.rs +++ b/components/layout_2020/display_list/mod.rs @@ -193,15 +193,13 @@ impl Fragment { section: StackingContextSection, ) { match self { - Fragment::Box(b) => match b.style.get_inherited_box().visibility { + Fragment::Box(b) | Fragment::Float(b) => match b.style.get_inherited_box().visibility { Visibility::Visible => { BuilderForBoxFragment::new(b, containing_block).build(builder, section) }, Visibility::Hidden => (), Visibility::Collapse => (), }, - Fragment::HoistedFloat(_) => {}, - Fragment::Float => {}, Fragment::AbsoluteOrFixedPositioned(_) => {}, Fragment::Anonymous(_) => {}, Fragment::Image(i) => match i.style.get_inherited_box().visibility { diff --git a/components/layout_2020/display_list/stacking_context.rs b/components/layout_2020/display_list/stacking_context.rs index b9489308318..77421ea59a9 100644 --- a/components/layout_2020/display_list/stacking_context.rs +++ b/components/layout_2020/display_list/stacking_context.rs @@ -7,7 +7,7 @@ use crate::cell::ArcRefCell; use crate::display_list::conversions::ToWebRender; use crate::display_list::DisplayListBuilder; use crate::fragment_tree::ContainingBlockManager; -use crate::fragments::{AnonymousFragment, BoxFragment, Fragment, HoistedFloatFragment}; +use crate::fragments::{AnonymousFragment, BoxFragment, Fragment}; use crate::geom::PhysicalRect; use crate::style_ext::ComputedValuesExt; use crate::FragmentTree; @@ -531,7 +531,7 @@ impl Fragment { ) { let containing_block = containing_block_info.get_containing_block_for_fragment(self); match self { - Fragment::Box(fragment) => { + Fragment::Box(fragment) | Fragment::Float(fragment) => { if mode == StackingContextBuildMode::SkipHoisted && fragment.style.clone_position().is_absolutely_positioned() { @@ -554,14 +554,6 @@ impl Fragment { stacking_context, ); }, - Fragment::HoistedFloat(fragment) => { - fragment.build_stacking_context_tree( - display_list, - containing_block_info, - stacking_context, - ); - }, - Fragment::Float => {}, Fragment::AbsoluteOrFixedPositioned(fragment) => { let shared_fragment = fragment.borrow(); let fragment_ref = match shared_fragment.fragment.as_ref() { @@ -1103,20 +1095,3 @@ impl AnonymousFragment { } } } - -impl HoistedFloatFragment { - fn build_stacking_context_tree( - &self, - display_list: &mut DisplayList, - containing_block_info: &ContainingBlockInfo, - stacking_context: &mut StackingContext, - ) { - self.fragment.borrow().build_stacking_context_tree( - &self.fragment, - display_list, - containing_block_info, - stacking_context, - StackingContextBuildMode::SkipHoisted, - ); - } -} diff --git a/components/layout_2020/flow/float.rs b/components/layout_2020/flow/float.rs index d85b364b694..97423e7d070 100644 --- a/components/layout_2020/flow/float.rs +++ b/components/layout_2020/flow/float.rs @@ -6,22 +6,22 @@ //! //! See CSS 2.1 § 9.5.1: https://www.w3.org/TR/CSS2/visuren.html#float-position -use crate::cell::ArcRefCell; use crate::context::LayoutContext; use crate::dom::NodeExt; use crate::dom_traversal::{Contents, NodeAndStyleInfo}; use crate::formatting_contexts::IndependentFormattingContext; -use crate::fragments::{BoxFragment, CollapsedBlockMargins, CollapsedMargin, FloatFragment}; -use crate::fragments::{Fragment, HoistedFloatFragment}; +use crate::fragments::{ + BoxFragment, CollapsedBlockMargins, CollapsedMargin, FloatFragment, Fragment, +}; use crate::geom::flow_relative::{Rect, Vec2}; use crate::positioned::PositioningContext; use crate::style_ext::{ComputedValuesExt, DisplayInside}; use crate::ContainingBlock; use euclid::num::Zero; use servo_arc::Arc; -use std::f32; use std::fmt::{Debug, Formatter, Result as FmtResult}; use std::ops::Range; +use std::{f32, mem}; use style::computed_values::clear::T as ClearProperty; use style::computed_values::float::T as FloatProperty; use style::properties::ComputedValues; @@ -35,12 +35,49 @@ pub(crate) struct FloatBox { pub contents: IndependentFormattingContext, } +/// `FloatContext` positions floats relative to the independent block formatting +/// context which contains the floating elements. The Fragment tree positions +/// elements relative to their containing blocks. This data structure is used to +/// help map between these two coordinate systems. +#[derive(Clone, Copy, Debug)] +pub(crate) struct ContainingBlockPositionInfo { + /// The distance from the block start of the independent block formatting + /// context that contains the floats and the block start of the current + /// containing block, excluding uncollapsed block start margins. Note that + /// this does not include uncollapsed block start margins because we don't + /// know the value of collapsed margins until we lay out children. + pub block_start: Length, + /// Any uncollapsed block start margins that we have collected between the + /// block start of the float containing independent block formatting context + /// and this containing block, including for this containing block. + pub block_start_margins_not_collapsed: CollapsedMargin, + /// The distance from the inline start position of the float containing + /// independent formatting context and the inline start of this containing + /// block. + pub inline_start: Length, + /// The offset from the inline start position of the float containing + /// independent formatting context to the inline end of this containing + /// block. + pub inline_end: Length, +} + +impl ContainingBlockPositionInfo { + fn new() -> ContainingBlockPositionInfo { + ContainingBlockPositionInfo { + block_start: Length::zero(), + block_start_margins_not_collapsed: CollapsedMargin::zero(), + inline_start: Length::zero(), + inline_end: Length::new(f32::INFINITY), + } + } +} + /// Data kept during layout about the floats in a given block formatting context. /// /// This is a persistent data structure. Each float has its own private copy of the float context, /// although such copies may share portions of the `bands` tree. #[derive(Clone, Debug)] -pub struct FloatContext { +pub(crate) struct FloatContext { /// A persistent AA tree of float bands. /// /// This tree is immutable; modification operations return the new tree, which may share nodes @@ -49,27 +86,16 @@ pub struct FloatContext { /// The current (logically) vertical position. No new floats may be placed (logically) above /// this line. pub ceiling: Length, - /// Distances from the logical left side of the block formatting context to the logical sides - /// of the current containing block. - pub walls: InlineWalls, + /// Details about the position of the containing block relative to the + /// independent block formatting context that contains all of the floats + /// this `FloatContext` positions. + pub containing_block_info: ContainingBlockPositionInfo, /// The (logically) lowest margin edge of the last left float. pub clear_left_position: Length, /// The (logically) lowest margin edge of the last right float. pub clear_right_position: Length, } -/// Distances from the logical left side of the block formatting context to the logical sides of -/// the current containing block. -#[derive(Clone, Copy, Debug)] -pub struct InlineWalls { - /// The distance from the logical left side of the block formatting context to the logical - /// left side of the current containing block. - pub left: Length, - /// The distance from the logical *left* side of the block formatting context to the logical - /// right side of this object's containing block. - pub right: Length, -} - impl FloatContext { /// Returns a new float context representing a containing block with the given content /// inline-size. @@ -88,17 +114,12 @@ impl FloatContext { FloatContext { bands, ceiling: Length::zero(), - walls: InlineWalls::new(), + containing_block_info: ContainingBlockPositionInfo::new(), clear_left_position: Length::zero(), clear_right_position: Length::zero(), } } - /// Returns the current ceiling value. No new floats may be placed (logically) above this line. - pub fn ceiling(&self) -> Length { - self.ceiling - } - /// (Logically) lowers the ceiling to at least `new_ceiling` units. /// /// If the ceiling is already logically lower (i.e. larger) than this, does nothing. @@ -124,7 +145,7 @@ impl FloatContext { // Find the first band this float fits in. let mut first_band = self.bands.find(ceiling).unwrap(); - while !first_band.object_fits(&object, &self.walls) { + while !first_band.object_fits(&object, &self.containing_block_info) { let next_band = self.bands.find_next(first_band.top).unwrap(); if next_band.top.px().is_infinite() { break; @@ -136,8 +157,8 @@ impl FloatContext { match object.side { FloatSide::Left => { let left_object_edge = match first_band.left { - Some(band_left) => band_left.max(self.walls.left), - None => self.walls.left, + Some(band_left) => band_left.max(self.containing_block_info.inline_start), + None => self.containing_block_info.inline_start, }; Vec2 { inline: left_object_edge, @@ -146,8 +167,8 @@ impl FloatContext { }, FloatSide::Right => { let right_object_edge = match first_band.right { - Some(band_right) => band_right.min(self.walls.right), - None => self.walls.right, + Some(band_right) => band_right.min(self.containing_block_info.inline_end), + None => self.containing_block_info.inline_end, }; Vec2 { inline: right_object_edge - object.size.inline, @@ -210,15 +231,6 @@ impl FloatContext { } } -impl InlineWalls { - fn new() -> InlineWalls { - InlineWalls { - left: Length::zero(), - right: Length::new(f32::INFINITY), - } - } -} - /// Information needed to place an object so that it doesn't collide with existing floats. #[derive(Clone, Debug)] pub struct PlacementInfo { @@ -291,18 +303,18 @@ impl ClearSide { impl FloatBand { // Determines whether an object fits in a band. - fn object_fits(&self, object: &PlacementInfo, walls: &InlineWalls) -> bool { + fn object_fits(&self, object: &PlacementInfo, walls: &ContainingBlockPositionInfo) -> bool { match object.side { FloatSide::Left => { // Compute a candidate left position for the object. let candidate_left = match self.left { - None => walls.left, - Some(left) => left.max(walls.left), + None => walls.inline_start, + Some(left) => left.max(walls.inline_start), }; // If this band has an existing left float in it, then make sure that the object // doesn't stick out past the right edge (rule 7). - if self.left.is_some() && candidate_left + object.size.inline > walls.right { + if self.left.is_some() && candidate_left + object.size.inline > walls.inline_end { return false; } @@ -317,13 +329,14 @@ impl FloatBand { FloatSide::Right => { // Compute a candidate right position for the object. let candidate_right = match self.right { - None => walls.right, - Some(right) => right.min(walls.right), + None => walls.inline_end, + Some(right) => right.min(walls.inline_end), }; // If this band has an existing right float in it, then make sure that the new // object doesn't stick out past the left edge (rule 7). - if self.right.is_some() && candidate_right - object.size.inline < walls.left { + if self.right.is_some() && candidate_right - object.size.inline < walls.inline_start + { return false; } @@ -634,7 +647,7 @@ impl FloatBox { positioning_context: &mut PositioningContext, containing_block: &ContainingBlock, mut sequential_layout_state: Option<&mut SequentialLayoutState>, - ) { + ) -> Fragment { let sequential_layout_state = sequential_layout_state .as_mut() .expect("Tried to lay out a float with no sequential placement state!"); @@ -654,10 +667,9 @@ impl FloatBox { // FIXME(pcwalton): Implement the proper behavior when speculation fails. Either detect it // afterward and fix it up, or detect this situation ahead of time via lookahead and make // sure `current_margin` is accurate before calling this method. - sequential_layout_state.floats.lower_ceiling( - sequential_layout_state.bfc_relative_block_position + - sequential_layout_state.current_margin.solve(), - ); + sequential_layout_state + .floats + .lower_ceiling(sequential_layout_state.current_block_position_including_margins()); let style = match self.contents { IndependentFormattingContext::Replaced(ref replaced) => replaced.style.clone(), @@ -766,42 +778,12 @@ impl FloatBox { ) }, ); - sequential_layout_state.push_float_fragment(ArcRefCell::new(Fragment::Box(box_fragment))); + Fragment::Float(box_fragment) } } // Float fragment storage -// A persistent linked list that stores float fragments that need to be hoisted to their nearest -// ancestor containing block. -#[derive(Clone)] -struct FloatFragmentList { - root: FloatFragmentLink, -} - -// A single link in the float fragment list. -#[derive(Clone)] -struct FloatFragmentLink(Option>); - -// A single node in the float fragment list. -#[derive(Clone)] -struct FloatFragmentNode { - // The fragment. - fragment: ArcRefCell, - // The next fragment (previous in document order). - next: FloatFragmentLink, -} - -impl FloatFragmentList { - fn new() -> FloatFragmentList { - FloatFragmentList { - root: FloatFragmentLink(None), - } - } -} - -// Sequential layout state - // Layout state that we maintain when doing sequential traversals of the box tree in document // order. // @@ -816,18 +798,15 @@ impl FloatFragmentList { pub(crate) struct SequentialLayoutState { // Holds all floats in this block formatting context. pub(crate) floats: FloatContext, - // A list of all float fragments in this block formatting context. These are gathered up and - // hoisted to the top of the BFC. - bfc_float_fragments: FloatFragmentList, // The (logically) bottom border edge or top padding edge of the last in-flow block. Floats // cannot be placed above this line. // // This is often, but not always, the same as the float ceiling. The float ceiling can be lower // than this value because this value is calculated based on in-flow boxes only, while // out-of-flow floats can affect the ceiling as well (see CSS 2.1 § 9.5.1 rule 6). - bfc_relative_block_position: Length, + pub(crate) bfc_relative_block_position: Length, // Any collapsible margins that we've encountered after `bfc_relative_block_position`. - current_margin: CollapsedMargin, + pub(crate) current_margin: CollapsedMargin, } impl SequentialLayoutState { @@ -837,7 +816,6 @@ impl SequentialLayoutState { floats: FloatContext::new(), current_margin: CollapsedMargin::zero(), bfc_relative_block_position: Length::zero(), - bfc_float_fragments: FloatFragmentList::new(), } } @@ -849,6 +827,18 @@ impl SequentialLayoutState { self.floats.lower_ceiling(self.bfc_relative_block_position); } + pub(crate) fn update_all_containing_block_offsets( + &mut self, + mut new_distance: ContainingBlockPositionInfo, + ) -> ContainingBlockPositionInfo { + mem::swap(&mut new_distance, &mut self.floats.containing_block_info); + new_distance + } + + pub(crate) fn current_block_position_including_margins(&self) -> Length { + self.bfc_relative_block_position + self.current_margin.solve() + } + // Collapses margins, moving the block position down by the collapsed value of `current_margin` // and resetting `current_margin` to zero. // @@ -869,8 +859,7 @@ impl SequentialLayoutState { return Length::zero(); } - let hypothetical_block_position = - self.bfc_relative_block_position + self.current_margin.solve(); + let hypothetical_block_position = self.current_block_position_including_margins(); let clear_position = match clear_side { ClearSide::None => unreachable!(), ClearSide::Left => self @@ -894,25 +883,4 @@ impl SequentialLayoutState { pub(crate) fn adjoin_assign(&mut self, margin: &CollapsedMargin) { self.current_margin.adjoin_assign(margin) } - - /// Adds the float fragment to this list. - pub(crate) fn push_float_fragment(&mut self, new_float_fragment: ArcRefCell) { - self.bfc_float_fragments.root.0 = Some(Arc::new(FloatFragmentNode { - fragment: new_float_fragment, - next: FloatFragmentLink(self.bfc_float_fragments.root.0.take()), - })); - } - - /// Adds the float fragments we've been building up to the given vector. - pub(crate) fn add_float_fragments_to_list(&self, fragment_list: &mut Vec) { - let start_index = fragment_list.len(); - let mut link = &self.bfc_float_fragments.root; - while let Some(ref node) = link.0 { - fragment_list.push(Fragment::HoistedFloat(HoistedFloatFragment { - fragment: node.fragment.clone(), - })); - link = &node.next; - } - fragment_list[start_index..].reverse(); - } } diff --git a/components/layout_2020/flow/inline.rs b/components/layout_2020/flow/inline.rs index 4bf9ec5012a..962a90e9213 100644 --- a/components/layout_2020/flow/inline.rs +++ b/components/layout_2020/flow/inline.rs @@ -352,15 +352,29 @@ impl InlineFormattingContext { .push(Fragment::AbsoluteOrFixedPositioned(hoisted_fragment)); }, InlineLevelBox::OutOfFlowFloatBox(box_) => { - box_.layout( + let mut fragment = box_.layout( layout_context, ifc.positioning_context, containing_block, ifc.sequential_layout_state.as_mut().map(|c| &mut **c), ); - ifc.current_nesting_level - .fragments_so_far - .push(Fragment::Float); + if let Some(state) = &ifc.sequential_layout_state { + let offset_from_formatting_context_to_containing_block = Vec2 { + inline: state.floats.containing_block_info.inline_start, + block: state.floats.containing_block_info.block_start + + state + .floats + .containing_block_info + .block_start_margins_not_collapsed + .solve(), + }; + if let Fragment::Float(ref mut box_fragment) = &mut fragment { + box_fragment.content_rect.start_corner = + &box_fragment.content_rect.start_corner - + &offset_from_formatting_context_to_containing_block; + } + } + ifc.current_nesting_level.fragments_so_far.push(fragment); }, } } else diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index f2e6283a3ec..22c23253be4 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -4,9 +4,11 @@ //! Flow layout, also known as block-and-inline layout. +use std::ops::DerefMut; + use crate::cell::ArcRefCell; use crate::context::LayoutContext; -use crate::flow::float::{ClearSide, FloatBox, SequentialLayoutState}; +use crate::flow::float::{ClearSide, ContainingBlockPositionInfo, FloatBox, SequentialLayoutState}; use crate::flow::inline::InlineFormattingContext; use crate::formatting_contexts::{ IndependentFormattingContext, IndependentLayout, NonReplacedFormattingContext, @@ -82,7 +84,7 @@ impl BlockFormattingContext { None }; - let mut flow_layout = self.contents.layout( + let flow_layout = self.contents.layout( layout_context, positioning_context, containing_block, @@ -96,11 +98,6 @@ impl BlockFormattingContext { .collapsed_through ); - // FIXME(pcwalton): Relative positioning of ancestors should affect descendant floats. - if let Some(ref sequential_layout_state) = sequential_layout_state { - sequential_layout_state.add_float_fragments_to_list(&mut flow_layout.fragments); - } - IndependentLayout { fragments: flow_layout.fragments, content_block_size: flow_layout.content_block_size + @@ -267,7 +264,10 @@ fn layout_block_level_children_sequentially( tree_rank, Some(&mut *sequential_layout_state), ); + placement_state.place_fragment(&mut fragment); + placement_state + .adjust_positions_of_float_children(&mut fragment, sequential_layout_state); fragment }) .collect() @@ -364,15 +364,12 @@ impl BlockLevelBox { positioning_context.push(hoisted_box); Fragment::AbsoluteOrFixedPositioned(hoisted_fragment) }, - BlockLevelBox::OutOfFlowFloatBox(box_) => { - box_.layout( - layout_context, - positioning_context, - containing_block, - sequential_layout_state, - ); - Fragment::Float - }, + BlockLevelBox::OutOfFlowFloatBox(box_) => box_.layout( + layout_context, + positioning_context, + containing_block, + sequential_layout_state, + ), } } @@ -489,9 +486,9 @@ fn layout_in_flow_non_replaced_block_level( min_box_size.block == Length::zero(); let mut clearance = Length::zero(); - let old_inline_walls; + let parent_containing_block_position_info; match sequential_layout_state { - None => old_inline_walls = None, + None => parent_containing_block_position_info = None, Some(ref mut sequential_layout_state) => { sequential_layout_state.adjoin_assign(&CollapsedMargin::new(margin.block_start)); if !start_margin_can_collapse_with_children { @@ -508,12 +505,26 @@ fn layout_in_flow_non_replaced_block_level( pbm.padding.block_start + pbm.border.block_start + clearance, ); - // Store our old inline walls so we can reset them later. - old_inline_walls = Some(sequential_layout_state.floats.walls); - sequential_layout_state.floats.walls.left += - pbm.padding.inline_start + pbm.border.inline_start + margin.inline_start; - sequential_layout_state.floats.walls.right = - sequential_layout_state.floats.walls.left + inline_size; + // We are about to lay out children. Update the offset between the block formatting + // context and the containing block that we create for them. This offset is used to + // ajust BFC relative coordinates to coordinates that are relative to our content box. + // Our content box establishes the containing block for non-abspos children, including + // floats. + let inline_start = sequential_layout_state + .floats + .containing_block_info + .inline_start + + pbm.padding.inline_start + + pbm.border.inline_start + + margin.inline_start; + let new_cb_offsets = ContainingBlockPositionInfo { + block_start: sequential_layout_state.bfc_relative_block_position, + block_start_margins_not_collapsed: sequential_layout_state.current_margin, + inline_start, + inline_end: inline_start + inline_size, + }; + parent_containing_block_position_info = + Some(sequential_layout_state.update_all_containing_block_offsets(new_cb_offsets)); }, }; @@ -579,8 +590,10 @@ fn layout_in_flow_non_replaced_block_level( }); if let Some(ref mut sequential_layout_state) = sequential_layout_state { - // Now that we're done laying out our children, we can restore the old inline walls. - sequential_layout_state.floats.walls = old_inline_walls.unwrap(); + // Now that we're done laying out our children, we can restore the + // parent's containing block position information. + sequential_layout_state + .update_all_containing_block_offsets(parent_containing_block_position_info.unwrap()); // Account for padding and border. We also might have to readjust the // `bfc_relative_block_position` if it was different from the content size (i.e. was @@ -749,7 +762,7 @@ impl PlacementState { }; fragment.borrow_mut().adjust_offsets(offset); }, - Fragment::Anonymous(_) | Fragment::Float => {}, + Fragment::Anonymous(_) | Fragment::Float(_) => {}, _ => unreachable!(), } } @@ -761,4 +774,53 @@ impl PlacementState { end: self.current_margin, } } + + /// When Float fragments are created in block flows, they are positioned + /// relative to the float containing independent block formatting context. + /// Once we place a float's containing block, this function can be used to + /// fix up the float position to be relative to the containing block. + fn adjust_positions_of_float_children( + &self, + fragment: &mut Fragment, + sequential_layout_state: &mut SequentialLayoutState, + ) { + let fragment = match fragment { + Fragment::Box(ref mut fragment) => fragment, + _ => return, + }; + + // TODO(mrobinson): Will these margins be accurate if this fragment + // collapses through. Can a fragment collapse through when it has a + // non-zero sized float inside? The float won't be positioned correctly + // anyway (see the comment in `floats.rs` about margin collapse), but + // this might make the result even worse. + let collapsed_margins = self.collapsible_margins_in_children().start.adjoin( + &sequential_layout_state + .floats + .containing_block_info + .block_start_margins_not_collapsed, + ); + + let parent_fragment_offset_in_cb = &fragment.content_rect.start_corner; + let parent_fragment_offset_in_formatting_context = Vec2 { + inline: sequential_layout_state + .floats + .containing_block_info + .inline_start + + parent_fragment_offset_in_cb.inline, + block: sequential_layout_state + .floats + .containing_block_info + .block_start + + collapsed_margins.solve() + + parent_fragment_offset_in_cb.block, + }; + + for child_fragment in fragment.children.iter_mut() { + if let Fragment::Float(box_fragment) = child_fragment.borrow_mut().deref_mut() { + box_fragment.content_rect.start_corner = &box_fragment.content_rect.start_corner - + &parent_fragment_offset_in_formatting_context; + } + } + } } diff --git a/components/layout_2020/flow/root.rs b/components/layout_2020/flow/root.rs index 446fe002bc4..39f82e85fa0 100644 --- a/components/layout_2020/flow/root.rs +++ b/components/layout_2020/flow/root.rs @@ -440,14 +440,12 @@ impl FragmentTree { } let fragment_relative_rect = match fragment { - Fragment::Box(fragment) => fragment + Fragment::Box(fragment) | Fragment::Float(fragment) => fragment .border_rect() .to_physical(fragment.style.writing_mode, &containing_block), Fragment::Text(fragment) => fragment .rect .to_physical(fragment.parent_style.writing_mode, &containing_block), - Fragment::HoistedFloat(_) | - Fragment::Float | Fragment::AbsoluteOrFixedPositioned(_) | Fragment::Image(_) | Fragment::IFrame(_) | @@ -521,15 +519,13 @@ impl FragmentTree { } scroll_area = match fragment { - Fragment::Box(fragment) => fragment + Fragment::Box(fragment) | Fragment::Float(fragment) => fragment .scrollable_overflow(&containing_block) .translate(containing_block.origin.to_vector()), Fragment::Text(_) | Fragment::AbsoluteOrFixedPositioned(_) | Fragment::Image(_) | Fragment::IFrame(_) | - Fragment::Float | - Fragment::HoistedFloat(_) | Fragment::Anonymous(_) => return None, }; None::<()> diff --git a/components/layout_2020/fragments.rs b/components/layout_2020/fragments.rs index f557d16db7e..f4b25ca2b46 100644 --- a/components/layout_2020/fragments.rs +++ b/components/layout_2020/fragments.rs @@ -26,11 +26,12 @@ use webrender_api::{FontInstanceKey, ImageKey}; #[derive(Serialize)] pub(crate) enum Fragment { Box(BoxFragment), - // The original document position of a float in the document tree. - Float, - // A float hoisted up from its original position (where a placeholder `Fragment::Float` is) to - // its containing block. - HoistedFloat(HoistedFloatFragment), + /// Floating content. A floated fragment is very similar to a normal + /// [BoxFragment] but it isn't positioned using normal in block flow + /// positioning rules (margin collapse, etc). Instead, they are laid out by + /// the [SequentialLayoutState] of their float containing block formatting + /// context. + Float(BoxFragment), Anonymous(AnonymousFragment), /// Absolute and fixed position fragments are hoisted up so that they /// are children of the BoxFragment that establishes their containing @@ -45,13 +46,6 @@ pub(crate) enum Fragment { IFrame(IFrameFragment), } -// A float hoisted up from its original position (where a placeholder `Fragment::Float` is) to its -// containing block. -#[derive(Serialize)] -pub(crate) struct HoistedFloatFragment { - pub fragment: ArcRefCell, -} - #[derive(Serialize)] pub(crate) struct BoxFragment { pub base: BaseFragment, @@ -171,9 +165,7 @@ impl Fragment { pub fn offset_inline(&mut self, offset: &Length) { let position = match self { Fragment::Box(f) => &mut f.content_rect.start_corner, - Fragment::HoistedFloat(_) | - Fragment::Float | - Fragment::AbsoluteOrFixedPositioned(_) => return, + Fragment::Float(_) | Fragment::AbsoluteOrFixedPositioned(_) => return, Fragment::Anonymous(f) => &mut f.rect.start_corner, Fragment::Text(f) => &mut f.rect.start_corner, Fragment::Image(f) => &mut f.rect.start_corner, @@ -187,12 +179,11 @@ impl Fragment { Some(match self { Fragment::Box(fragment) => &fragment.base, Fragment::Text(fragment) => &fragment.base, - Fragment::Float => return None, Fragment::AbsoluteOrFixedPositioned(_) => return None, Fragment::Anonymous(fragment) => &fragment.base, Fragment::Image(fragment) => &fragment.base, Fragment::IFrame(fragment) => &fragment.base, - Fragment::HoistedFloat(_) => return None, + Fragment::Float(fragment) => &fragment.base, }) } @@ -203,8 +194,11 @@ impl Fragment { pub fn print(&self, tree: &mut PrintTree) { match self { Fragment::Box(fragment) => fragment.print(tree), - Fragment::HoistedFloat(fragment) => fragment.print(tree), - Fragment::Float => tree.add_item(format!("Float")), + Fragment::Float(fragment) => { + tree.new_level(format!("Float")); + fragment.print(tree); + tree.end_level(); + }, Fragment::AbsoluteOrFixedPositioned(_) => { tree.add_item("AbsoluteOrFixedPositioned".to_string()); }, @@ -220,11 +214,10 @@ impl Fragment { containing_block: &PhysicalRect, ) -> PhysicalRect { match self { - Fragment::Box(fragment) => fragment.scrollable_overflow_for_parent(&containing_block), - Fragment::HoistedFloat(fragment) => { - (*fragment.fragment.borrow()).scrollable_overflow(&containing_block) + Fragment::Box(fragment) | Fragment::Float(fragment) => { + fragment.scrollable_overflow_for_parent(&containing_block) }, - Fragment::Float | Fragment::AbsoluteOrFixedPositioned(_) => PhysicalRect::zero(), + Fragment::AbsoluteOrFixedPositioned(_) => PhysicalRect::zero(), Fragment::Anonymous(fragment) => fragment.scrollable_overflow.clone(), Fragment::Text(fragment) => fragment .rect @@ -250,7 +243,7 @@ impl Fragment { } match self { - Fragment::Box(fragment) => { + Fragment::Box(fragment) | Fragment::Float(fragment) => { let content_rect = fragment .content_rect .to_physical(fragment.style.writing_mode, containing_block) @@ -294,15 +287,6 @@ impl Fragment { } } -impl HoistedFloatFragment { - #[allow(dead_code)] - pub fn print(&self, tree: &mut PrintTree) { - tree.new_level(format!("HoistedFloatFragment")); - self.fragment.borrow().print(tree); - tree.end_level(); - } -} - impl AnonymousFragment { pub fn new(rect: Rect, children: Vec, mode: WritingMode) -> Self { // FIXME(mrobinson, bug 25564): We should be using the containing block @@ -450,19 +434,17 @@ impl BoxFragment { \ncontent={:?}\ \npadding rect={:?}\ \nborder rect={:?}\ + \nclearance={:?}\ \nscrollable_overflow={:?}\ - \noverflow={:?} / {:?}\ - \noverconstrained={:?} - \nstyle={:p}", + \noverflow={:?} / {:?}", self.base, self.content_rect, self.padding_rect(), self.border_rect(), + self.clearance, self.scrollable_overflow(&PhysicalRect::zero()), self.style.get_box().overflow_x, self.style.get_box().overflow_y, - self.overconstrained, - self.style, )); for child in &self.children { diff --git a/components/layout_2020/positioned.rs b/components/layout_2020/positioned.rs index 2ac43c95057..384850c867b 100644 --- a/components/layout_2020/positioned.rs +++ b/components/layout_2020/positioned.rs @@ -794,7 +794,7 @@ fn adjust_static_positions( let child_fragment_rect = match &child_fragments[original_tree_rank] { Fragment::Box(b) => &b.content_rect, - Fragment::AbsoluteOrFixedPositioned(_) | Fragment::Float => continue, + Fragment::AbsoluteOrFixedPositioned(_) | Fragment::Float(_) => continue, Fragment::Anonymous(a) => &a.rect, _ => unreachable!(), }; diff --git a/components/layout_2020/query.rs b/components/layout_2020/query.rs index a0b3ce6a41a..7d19963b951 100644 --- a/components/layout_2020/query.rs +++ b/components/layout_2020/query.rs @@ -425,7 +425,7 @@ fn process_offset_parent_query_inner( // // [1]: https://github.com/w3c/csswg-drafts/issues/4541 let fragment_relative_rect = match fragment { - Fragment::Box(fragment) => fragment + Fragment::Box(fragment) | Fragment::Float(fragment) => fragment .border_rect() .to_physical(fragment.style.writing_mode, &containing_block), Fragment::Text(fragment) => fragment @@ -434,8 +434,6 @@ fn process_offset_parent_query_inner( Fragment::AbsoluteOrFixedPositioned(_) | Fragment::Image(_) | Fragment::IFrame(_) | - Fragment::Float | - Fragment::HoistedFloat(_) | Fragment::Anonymous(_) => unreachable!(), }; let border_box = fragment_relative_rect.translate(containing_block.origin.to_vector()); @@ -485,7 +483,7 @@ fn process_offset_parent_query_inner( } else { // Record the paths of the nodes being traversed. let parent_node_address = match fragment { - Fragment::Box(fragment) => { + Fragment::Box(fragment) | Fragment::Float(fragment) => { let is_eligible_parent = match (is_body_element, fragment.style.get_box().position) { // Spec says the element is eligible as `offsetParent` if any of @@ -512,8 +510,6 @@ fn process_offset_parent_query_inner( Fragment::Text(_) | Fragment::Image(_) | Fragment::IFrame(_) | - Fragment::Float | - Fragment::HoistedFloat(_) | Fragment::Anonymous(_) => None, }; @@ -544,29 +540,28 @@ fn process_offset_parent_query_inner( fragment_tree .find(|fragment, _, containing_block| { match fragment { - Fragment::Box(fragment) - if fragment.base.tag == Some(offset_parent_node_tag) => - { - // Again, take the *first* associated CSS layout box. - let padding_box_corner = fragment - .padding_rect() - .to_physical(fragment.style.writing_mode, &containing_block) - .origin - .to_vector() + - containing_block.origin.to_vector(); - let padding_box_corner = Vector2D::new( - Au::from_f32_px(padding_box_corner.x.px()), - Au::from_f32_px(padding_box_corner.y.px()), - ); - Some(padding_box_corner) + Fragment::Box(fragment) | Fragment::Float(fragment) => { + if fragment.base.tag == Some(offset_parent_node_tag) { + // Again, take the *first* associated CSS layout box. + let padding_box_corner = fragment + .padding_rect() + .to_physical(fragment.style.writing_mode, &containing_block) + .origin + .to_vector() + + containing_block.origin.to_vector(); + let padding_box_corner = Vector2D::new( + Au::from_f32_px(padding_box_corner.x.px()), + Au::from_f32_px(padding_box_corner.y.px()), + ); + Some(padding_box_corner) + } else { + None + } }, Fragment::AbsoluteOrFixedPositioned(_) | - Fragment::Box(_) | Fragment::Text(_) | Fragment::Image(_) | Fragment::IFrame(_) | - Fragment::Float | - Fragment::HoistedFloat(_) | Fragment::Anonymous(_) => None, } }) diff --git a/components/layout_2020/tests/floats.rs b/components/layout_2020/tests/floats.rs index affc67cdecf..ed804926125 100644 --- a/components/layout_2020/tests/floats.rs +++ b/components/layout_2020/tests/floats.rs @@ -9,7 +9,7 @@ extern crate lazy_static; use euclid::num::Zero; use layout::flow::float::{ClearSide, FloatBand, FloatBandNode, FloatBandTree, FloatContext}; -use layout::flow::float::{FloatSide, InlineWalls, PlacementInfo}; +use layout::flow::float::{ContainingBlockOffsets, FloatSide, PlacementInfo}; use layout::geom::flow_relative::{Rect, Vec2}; use quickcheck::{Arbitrary, Gen}; use std::f32; @@ -339,7 +339,7 @@ struct FloatInput { ceiling: u32, /// Distances from the logical left side of the block formatting context to the logical sides /// of the current containing block. - walls: InlineWalls, + cb_offset: ContainingBlockOffsets, } impl Arbitrary for FloatInput { @@ -366,7 +366,8 @@ impl Arbitrary for FloatInput { clear: new_clear_side(clear), }, ceiling, - walls: InlineWalls { + cb_offset: ContainingBlockOffsets { + top: Length::zero(), left: Length::new(left as f32), right: Length::new(right as f32), }, @@ -388,12 +389,12 @@ impl Arbitrary for FloatInput { this.info.clear = new_clear_side(clear_side); shrunk = true; } - if let Some(left) = self.walls.left.px().shrink().next() { - this.walls.left = Length::new(left); + if let Some(left) = self.cb_offset.left.px().shrink().next() { + this.cb_offset.left = Length::new(left); shrunk = true; } - if let Some(right) = self.walls.right.px().shrink().next() { - this.walls.right = Length::new(right); + if let Some(right) = self.cb_offset.right.px().shrink().next() { + this.cb_offset.right = Length::new(right); shrunk = true; } if let Some(ceiling) = self.ceiling.shrink().next() { @@ -429,7 +430,7 @@ struct PlacedFloat { origin: Vec2, info: PlacementInfo, ceiling: Length, - walls: InlineWalls, + walls: ContainingBlockOffsets, } impl Drop for FloatPlacement { @@ -470,12 +471,12 @@ impl FloatPlacement { for float in floats { let ceiling = Length::new(float.ceiling as f32); float_context.lower_ceiling(ceiling); - float_context.walls = float.walls; + float_context.cb_bfc_distance = float.cb_offset; placed_floats.push(PlacedFloat { origin: float_context.add_float(&float.info), info: float.info, ceiling, - walls: float.walls, + walls: float.cb_offset, }) } FloatPlacement { diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-child-with-margins-2.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-child-with-margins-2.html.ini new file mode 100644 index 00000000000..bd217127549 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/clear-on-child-with-margins-2.html.ini @@ -0,0 +1,2 @@ +[clear-on-child-with-margins-2.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/remove-block-before-self-collapsing-sibling-with-clearance.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/remove-block-before-self-collapsing-sibling-with-clearance.html.ini new file mode 100644 index 00000000000..70784ff0b07 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats-clear/remove-block-before-self-collapsing-sibling-with-clearance.html.ini @@ -0,0 +1,2 @@ +[remove-block-before-self-collapsing-sibling-with-clearance.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-no-interpolation.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-no-interpolation.html.ini index d731172896e..fd88cbf3ff4 100644 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-no-interpolation.html.ini +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-no-interpolation.html.ini @@ -8,18 +8,6 @@ [CSS Transitions with transition: all: property from [initial\] to [right\] at (0.3) should be [right\]] expected: FAIL - [CSS Animations: property from [initial\] to [right\] at (0.5) should be [right\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [right\] at (0.6) should be [right\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [right\] at (1) should be [right\]] - expected: FAIL - - [CSS Animations: property from [initial\] to [right\] at (1.5) should be [right\]] - expected: FAIL - [Web Animations: property from [initial\] to [right\] at (-0.3) should be [initial\]] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-root.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-root.html.ini index 8bb5b681b05..20839ed35d4 100644 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-root.html.ini +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-root.html.ini @@ -1,2 +1,2 @@ [float-root.html] - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-under-flatten-under-preserve-3d.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-under-flatten-under-preserve-3d.html.ini deleted file mode 100644 index 34417d4fee3..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/float-under-flatten-under-preserve-3d.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-under-flatten-under-preserve-3d.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-001.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-001.html.ini deleted file mode 100644 index 0842d0b5727..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-001.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[hit-test-floats-001.html] - [hit-test-floats-001] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini deleted file mode 100644 index 13bd6abf376..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[hit-test-floats-004.html] - [Miss float below something else] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini deleted file mode 100644 index 147f062e548..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[hit-test-floats-005.html] - [Miss clipped float] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-beside-adjoining-float.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-beside-adjoining-float.html.ini deleted file mode 100644 index 042b5c8181a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-beside-adjoining-float.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[new-fc-beside-adjoining-float.html] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-separates-from-float.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-separates-from-float.html.ini new file mode 100644 index 00000000000..75f0028b81a --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/new-fc-separates-from-float.html.ini @@ -0,0 +1,2 @@ +[new-fc-separates-from-float.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-001.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-001.html.ini deleted file mode 100644 index 585f7f61434..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-001.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[block-in-inline-hittest-float-001.html] - [block-in-inline-hittest-float-001] - expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-002.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-002.html.ini deleted file mode 100644 index 5fda15700c0..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/block-in-inline-hittest-float-002.html.ini +++ /dev/null @@ -1,15 +0,0 @@ -[block-in-inline-hittest-float-002.html] - [block-in-inline-hittest-float-002] - expected: FAIL - - [with background] - expected: FAIL - - [with padding] - expected: FAIL - - [floats before block-in-inline] - expected: FAIL - - [floats before block-in-inline with background] - expected: FAIL From 5c5cc4b7959f68a67e7ef9f99ece15f4ab98fe8c Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Wed, 31 May 2023 10:32:09 +0200 Subject: [PATCH 3/3] Fix the unit test These were broken for various issues. --- components/layout_2020/flow/float.rs | 26 +++++--- components/layout_2020/tests/floats.rs | 84 ++++++++++++++------------ 2 files changed, 63 insertions(+), 47 deletions(-) diff --git a/components/layout_2020/flow/float.rs b/components/layout_2020/flow/float.rs index 97423e7d070..582ca9e1242 100644 --- a/components/layout_2020/flow/float.rs +++ b/components/layout_2020/flow/float.rs @@ -40,17 +40,17 @@ pub(crate) struct FloatBox { /// elements relative to their containing blocks. This data structure is used to /// help map between these two coordinate systems. #[derive(Clone, Copy, Debug)] -pub(crate) struct ContainingBlockPositionInfo { +pub struct ContainingBlockPositionInfo { /// The distance from the block start of the independent block formatting /// context that contains the floats and the block start of the current /// containing block, excluding uncollapsed block start margins. Note that /// this does not include uncollapsed block start margins because we don't /// know the value of collapsed margins until we lay out children. - pub block_start: Length, + pub(crate) block_start: Length, /// Any uncollapsed block start margins that we have collected between the /// block start of the float containing independent block formatting context /// and this containing block, including for this containing block. - pub block_start_margins_not_collapsed: CollapsedMargin, + pub(crate) block_start_margins_not_collapsed: CollapsedMargin, /// The distance from the inline start position of the float containing /// independent formatting context and the inline start of this containing /// block. @@ -61,9 +61,9 @@ pub(crate) struct ContainingBlockPositionInfo { pub inline_end: Length, } -impl ContainingBlockPositionInfo { - fn new() -> ContainingBlockPositionInfo { - ContainingBlockPositionInfo { +impl Default for ContainingBlockPositionInfo { + fn default() -> Self { + Self { block_start: Length::zero(), block_start_margins_not_collapsed: CollapsedMargin::zero(), inline_start: Length::zero(), @@ -72,12 +72,22 @@ impl ContainingBlockPositionInfo { } } +impl ContainingBlockPositionInfo { + pub fn new_with_inline_offsets(inline_start: Length, inline_end: Length) -> Self { + Self { + inline_start, + inline_end, + ..Default::default() + } + } +} + /// Data kept during layout about the floats in a given block formatting context. /// /// This is a persistent data structure. Each float has its own private copy of the float context, /// although such copies may share portions of the `bands` tree. #[derive(Clone, Debug)] -pub(crate) struct FloatContext { +pub struct FloatContext { /// A persistent AA tree of float bands. /// /// This tree is immutable; modification operations return the new tree, which may share nodes @@ -114,7 +124,7 @@ impl FloatContext { FloatContext { bands, ceiling: Length::zero(), - containing_block_info: ContainingBlockPositionInfo::new(), + containing_block_info: Default::default(), clear_left_position: Length::zero(), clear_right_position: Length::zero(), } diff --git a/components/layout_2020/tests/floats.rs b/components/layout_2020/tests/floats.rs index ed804926125..089981021f7 100644 --- a/components/layout_2020/tests/floats.rs +++ b/components/layout_2020/tests/floats.rs @@ -9,7 +9,7 @@ extern crate lazy_static; use euclid::num::Zero; use layout::flow::float::{ClearSide, FloatBand, FloatBandNode, FloatBandTree, FloatContext}; -use layout::flow::float::{ContainingBlockOffsets, FloatSide, PlacementInfo}; +use layout::flow::float::{ContainingBlockPositionInfo, FloatSide, PlacementInfo}; use layout::geom::flow_relative::{Rect, Vec2}; use quickcheck::{Arbitrary, Gen}; use std::f32; @@ -57,8 +57,7 @@ impl<'a> Drop for PanicMsgSuppressor<'a> { struct FloatBandWrapper(FloatBand); impl Arbitrary for FloatBandWrapper { - fn arbitrary(generator: &mut Gen) -> FloatBandWrapper - { + fn arbitrary(generator: &mut Gen) -> FloatBandWrapper { let top: u32 = Arbitrary::arbitrary(generator); let left: Option = Arbitrary::arbitrary(generator); let right: Option = Arbitrary::arbitrary(generator); @@ -73,21 +72,17 @@ impl Arbitrary for FloatBandWrapper { #[derive(Clone, Debug)] struct FloatRangeInput { start_index: u32, - band_count: u32, side: FloatSide, length: u32, } impl Arbitrary for FloatRangeInput { - fn arbitrary(generator: &mut Gen) -> FloatRangeInput - { + fn arbitrary(generator: &mut Gen) -> FloatRangeInput { let start_index: u32 = Arbitrary::arbitrary(generator); - let band_count: u32 = Arbitrary::arbitrary(generator); let is_left: bool = Arbitrary::arbitrary(generator); let length: u32 = Arbitrary::arbitrary(generator); FloatRangeInput { start_index, - band_count, side: if is_left { FloatSide::Left } else { @@ -337,21 +332,25 @@ struct FloatInput { // The float may be placed no higher than this line. This simulates the effect of line boxes // per CSS 2.1 § 9.5.1 rule 6. ceiling: u32, - /// Distances from the logical left side of the block formatting context to the logical sides - /// of the current containing block. - cb_offset: ContainingBlockOffsets, + /// Containing block positioning information, which is used to track the current offsets + /// from the float containing block formatting context to the current containing block. + containing_block_info: ContainingBlockPositionInfo, } impl Arbitrary for FloatInput { - fn arbitrary(generator: &mut Gen) -> FloatInput - { - let width: u32 = Arbitrary::arbitrary(generator); - let height: u32 = Arbitrary::arbitrary(generator); - let is_left: bool = Arbitrary::arbitrary(generator); - let ceiling: u32 = Arbitrary::arbitrary(generator); - let left: u32 = Arbitrary::arbitrary(generator); - let right: u32 = Arbitrary::arbitrary(generator); - let clear: u8 = Arbitrary::arbitrary(generator); + fn arbitrary(generator: &mut Gen) -> FloatInput { + // See #29819: Limit the maximum size of all f32 values here because + // massive float values will start to introduce very bad floating point + // errors. + // TODO: This should be be addressed in a better way. Perhaps we should + // reintroduce the use of app_units in Layout 2020. + let width = u32::arbitrary(generator) % 12345; + let height = u32::arbitrary(generator) % 12345; + let is_left = bool::arbitrary(generator); + let ceiling = u32::arbitrary(generator) % 12345; + let left = u32::arbitrary(generator) % 12345; + let containing_block_width = u32::arbitrary(generator) % 12345; + let clear = u8::arbitrary(generator); FloatInput { info: PlacementInfo { size: Vec2 { @@ -366,11 +365,10 @@ impl Arbitrary for FloatInput { clear: new_clear_side(clear), }, ceiling, - cb_offset: ContainingBlockOffsets { - top: Length::zero(), - left: Length::new(left as f32), - right: Length::new(right as f32), - }, + containing_block_info: ContainingBlockPositionInfo::new_with_inline_offsets( + Length::new(left as f32), + Length::new(left as f32 + containing_block_width as f32), + ), } } @@ -389,12 +387,12 @@ impl Arbitrary for FloatInput { this.info.clear = new_clear_side(clear_side); shrunk = true; } - if let Some(left) = self.cb_offset.left.px().shrink().next() { - this.cb_offset.left = Length::new(left); + if let Some(left) = self.containing_block_info.inline_start.px().shrink().next() { + this.containing_block_info.inline_start = Length::new(left); shrunk = true; } - if let Some(right) = self.cb_offset.right.px().shrink().next() { - this.cb_offset.right = Length::new(right); + if let Some(right) = self.containing_block_info.inline_end.px().shrink().next() { + this.containing_block_info.inline_end = Length::new(right); shrunk = true; } if let Some(ceiling) = self.ceiling.shrink().next() { @@ -430,7 +428,7 @@ struct PlacedFloat { origin: Vec2, info: PlacementInfo, ceiling: Length, - walls: ContainingBlockOffsets, + containing_block_info: ContainingBlockPositionInfo, } impl Drop for FloatPlacement { @@ -447,8 +445,8 @@ impl Drop for FloatPlacement { placed_float.info, placed_float.origin, placed_float.ceiling, - placed_float.walls.left, - placed_float.walls.right, + placed_float.containing_block_info.inline_start, + placed_float.containing_block_info.inline_end, ); } eprintln!("Bands:\n{:?}\n", self.float_context.bands); @@ -471,12 +469,12 @@ impl FloatPlacement { for float in floats { let ceiling = Length::new(float.ceiling as f32); float_context.lower_ceiling(ceiling); - float_context.cb_bfc_distance = float.cb_offset; + float_context.containing_block_info = float.containing_block_info; placed_floats.push(PlacedFloat { origin: float_context.add_float(&float.info), info: float.info, ceiling, - walls: float.cb_offset, + containing_block_info: float.containing_block_info, }) } FloatPlacement { @@ -495,9 +493,14 @@ impl FloatPlacement { fn check_floats_rule_1(placement: &FloatPlacement) { for placed_float in &placement.placed_floats { match placed_float.info.side { - FloatSide::Left => assert!(placed_float.origin.inline >= placed_float.walls.left), + FloatSide::Left => assert!( + placed_float.origin.inline >= placed_float.containing_block_info.inline_start + ), FloatSide::Right => { - assert!(placed_float.rect().max_inline_position() <= placed_float.walls.right) + assert!( + placed_float.rect().max_inline_position() <= + placed_float.containing_block_info.inline_end + ) }, } } @@ -603,12 +606,14 @@ fn check_floats_rule_7(placement: &FloatPlacement) { // Only consider floats that stick out. match placed_float.info.side { FloatSide::Left => { - if placed_float.rect().max_inline_position() <= placed_float.walls.right { + if placed_float.rect().max_inline_position() <= + placed_float.containing_block_info.inline_end + { continue; } }, FloatSide::Right => { - if placed_float.origin.inline >= placed_float.walls.left { + if placed_float.origin.inline >= placed_float.containing_block_info.inline_start { continue; } }, @@ -668,7 +673,7 @@ fn check_floats_rule_9(floats_and_perturbations: Vec<(FloatInput, u32)>) { let mut placement = placement.clone(); { - let mut placed_float = &mut placement.placed_floats[float_index]; + let placed_float = &mut placement.placed_floats[float_index]; let perturbation = Length::new(perturbation as f32); match placed_float.info.side { FloatSide::Left => { @@ -754,6 +759,7 @@ fn check_basic_float_rules(placement: &FloatPlacement) { fn test_floats_rule_1() { let f: fn(Vec) = check; quickcheck::quickcheck(f); + fn check(floats: Vec) { check_floats_rule_1(&FloatPlacement::place(floats)); }