From 344b1a1ddc143cbfbfcd2dfcfda301e34f01bc67 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Tue, 3 Mar 2026 14:29:29 +0100 Subject: [PATCH] LibWeb: Hoist fieldset contents into anonymous wrapper Make an anonymous wrapper for a fieldset's contents, excluding its legend, as the spec asks us to do. This will make sure we can apply certain CSS properties to the correct box. Fixes #6747 --- Libraries/LibWeb/Layout/TreeBuilder.cpp | 37 ++ Libraries/LibWeb/Layout/TreeBuilder.h | 3 - .../expected/fieldset-legend-variations.txt | 352 ++++++++++-------- .../fieldset-with-rendered-legend.txt | 2 + .../input/fieldset-legend-variations.html | 5 + 5 files changed, 240 insertions(+), 159 deletions(-) diff --git a/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Libraries/LibWeb/Layout/TreeBuilder.cpp index 704645f797..a60470fa7a 100644 --- a/Libraries/LibWeb/Layout/TreeBuilder.cpp +++ b/Libraries/LibWeb/Layout/TreeBuilder.cpp @@ -945,6 +945,43 @@ void TreeBuilder::update_layout_tree_after_children(DOM::Node& dom_node, GC::Ref create_pseudo_element_if_needed(element, CSS::PseudoElement::After, AppendOrPrepend::Append); pop_parent(); } + + // https://html.spec.whatwg.org/multipage/rendering.html#the-fieldset-and-legend-elements + // The anonymous fieldset content box is expected to appear after the rendered legend and is expected to contain the + // content (including the '::before' and '::after' pseudo-elements) of the fieldset element except for the rendered + // legend, if there is one. + if (auto* fieldset_box = as_if(*layout_node)) { + if (auto legend = fieldset_box->rendered_legend()) { + auto wrapper = fieldset_box->create_anonymous_wrapper(); + auto& wrapper_mutable_values = wrapper->mutable_computed_values(); + wrapper_mutable_values.set_display(CSS::Display::from_short(CSS::Display::Short::FlowRoot)); + + // https://html.spec.whatwg.org/multipage/rendering.html#the-fieldset-and-legend-elements + // The following properties are expected to inherit from the fieldset element: + // align-content, align-items, border-radius, column-count, column-fill, column-gap, column-rule, + // column-width, flex-direction, flex-wrap, grid (grid-auto-columns, grid-auto-flow, grid-auto-rows, + // grid-column-gap, grid-row-gap, grid-template-areas, grid-template-columns, grid-template-rows), + // justify-content, justify-items, overflow, padding, text-overflow, unicode-bidi + // FIXME: Transfer all of these properties, not just overflow. + auto& fieldset_mutable_values = fieldset_box->mutable_computed_values(); + + wrapper_mutable_values.set_overflow_x(fieldset_box->computed_values().overflow_x()); + fieldset_mutable_values.set_overflow_x(CSS::InitialValues::overflow()); + + wrapper_mutable_values.set_overflow_y(fieldset_box->computed_values().overflow_y()); + fieldset_mutable_values.set_overflow_y(CSS::InitialValues::overflow()); + + for (GC::Ptr child = fieldset_box->first_child(); child;) { + auto next = child->next_sibling(); + if (child != legend) { + fieldset_box->remove_child(*child); + wrapper->append_child(*child); + } + child = next; + } + fieldset_box->append_child(*wrapper); + } + } } GC::Ptr TreeBuilder::build(DOM::Node& dom_node) diff --git a/Libraries/LibWeb/Layout/TreeBuilder.h b/Libraries/LibWeb/Layout/TreeBuilder.h index 0a14e1cc68..4f7497cbc4 100644 --- a/Libraries/LibWeb/Layout/TreeBuilder.h +++ b/Libraries/LibWeb/Layout/TreeBuilder.h @@ -6,10 +6,7 @@ #pragma once -#include #include -#include -#include #include namespace Web::Layout { diff --git a/Tests/LibWeb/Layout/expected/fieldset-legend-variations.txt b/Tests/LibWeb/Layout/expected/fieldset-legend-variations.txt index cedd0c5d0b..a8b6d4eff2 100644 --- a/Tests/LibWeb/Layout/expected/fieldset-legend-variations.txt +++ b/Tests/LibWeb/Layout/expected/fieldset-legend-variations.txt @@ -1,117 +1,121 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline - BlockContainer at [0,0] [0+0+0 800 0+0+0] [0+0+0 775 0+0+0] [BFC] children: not-inline - BlockContainer at [8,8] [8+0+0 784 0+0+8] [8+0+0 751 0+0+16] children: not-inline + BlockContainer at [0,0] [0+0+0 800 0+0+0] [0+0+0 811 0+0+0] [BFC] children: not-inline + BlockContainer at [8,8] [8+0+0 784 0+0+8] [8+0+0 787 0+0+16] children: not-inline FieldSetBox
at [10,26] [0+2+0 780 0+2+0] [0+18+0 18 0+2+16] [BFC] children: not-inline - BlockContainer <(anonymous)> at [10,26] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) LegendBox at [10,8] [0+0+0 56.5 0+0+0] [0+0+0 18 0+0+0] children: inline frag 0 from TextNode start: 0, length: 7, rect: [10,8 56.5x18] baseline: 13.796875 "Default" TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,26] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) - BlockContainer

at [10,26] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] children: inline - frag 0 from TextNode start: 0, length: 7, rect: [10,26 62.328125x18] baseline: 13.796875 - "Content" - TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,44] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,26] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [10,26] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,26] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer

at [10,26] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [10,26 62.328125x18] baseline: 13.796875 + "Content" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,44] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) BlockContainer <(anonymous)> at [8,62] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) TextNode <#text> (not painted) FieldSetBox

at [8,80] [0+0+0 784 0+0+0] [0+18+0 18 0+0+16] [BFC] children: not-inline - BlockContainer <(anonymous)> at [8,80] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) LegendBox at [8,62] [0+0+0 82.703125 0+0+0] [0+0+0 18 0+0+0] children: inline frag 0 from TextNode start: 0, length: 9, rect: [8,62 82.703125x18] baseline: 13.796875 "No border" TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [8,80] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) - BlockContainer

at [8,80] [0+0+0 784 0+0+0] [0+0+0 18 0+0+0] children: inline - frag 0 from TextNode start: 0, length: 7, rect: [8,80 62.328125x18] baseline: 13.796875 - "Content" - TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [8,98] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [8,80] [0+0+0 784 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [8,80] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [8,80] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer

at [8,80] [0+0+0 784 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [8,80 62.328125x18] baseline: 13.796875 + "Content" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [8,98] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) BlockContainer <(anonymous)> at [8,114] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) TextNode <#text> (not painted) FieldSetBox

at [13,132] [0+5+0 774 0+5+0] [0+18+0 18 0+5+16] [BFC] children: not-inline - BlockContainer <(anonymous)> at [13,132] [0+0+0 774 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) LegendBox at [13,114] [0+0+0 104.828125 0+0+0] [0+0+0 18 0+0+0] children: inline frag 0 from TextNode start: 0, length: 12, rect: [13,114 104.828125x18] baseline: 13.796875 "Thick border" TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [13,132] [0+0+0 774 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) - BlockContainer

at [13,132] [0+0+0 774 0+0+0] [0+0+0 18 0+0+0] children: inline - frag 0 from TextNode start: 0, length: 7, rect: [13,132 62.328125x18] baseline: 13.796875 - "Content" - TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [13,150] [0+0+0 774 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [13,132] [0+0+0 774 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [13,132] [0+0+0 774 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [13,132] [0+0+0 774 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer

at [13,132] [0+0+0 774 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [13,132 62.328125x18] baseline: 13.796875 + "Content" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [13,150] [0+0+0 774 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) BlockContainer <(anonymous)> at [8,171] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) TextNode <#text> (not painted) FieldSetBox

at [10,209] [0+2+0 780 0+2+0] [0+38+0 18 0+2+16] [BFC] children: not-inline - BlockContainer <(anonymous)> at [10,209] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) LegendBox at [20,181] [0+0+10 84.8125 10+0+0] [0+0+10 18 10+0+0] children: inline frag 0 from TextNode start: 0, length: 11, rect: [20,181 84.8125x18] baseline: 13.796875 "Tall legend" TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,209] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) - BlockContainer

at [10,209] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] children: inline - frag 0 from TextNode start: 0, length: 7, rect: [10,209 62.328125x18] baseline: 13.796875 - "Content" - TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,227] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,209] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [10,209] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,209] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer

at [10,209] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [10,209 62.328125x18] baseline: 13.796875 + "Content" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,227] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) BlockContainer <(anonymous)> at [8,245] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) TextNode <#text> (not painted) FieldSetBox

at [28,265] [0+20+0 744 0+20+0] [0+20+0 18 0+20+16] [BFC] children: not-inline - BlockContainer <(anonymous)> at [28,265] [0+0+0 744 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) LegendBox at [28,246] [0+0+0 202.90625 0+0+0] [0+0+0 18 0+0+0] children: inline frag 0 from TextNode start: 0, length: 25, rect: [28,246 202.90625x18] baseline: 13.796875 "Thin legend, thick border" TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [28,265] [0+0+0 744 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) - BlockContainer

at [28,265] [0+0+0 744 0+0+0] [0+0+0 18 0+0+0] children: inline - frag 0 from TextNode start: 0, length: 7, rect: [28,265 62.328125x18] baseline: 13.796875 - "Content" - TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [28,283] [0+0+0 744 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [28,265] [0+0+0 744 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [28,265] [0+0+0 744 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [28,265] [0+0+0 744 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer

at [28,265] [0+0+0 744 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [28,265 62.328125x18] baseline: 13.796875 + "Content" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [28,283] [0+0+0 744 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) BlockContainer <(anonymous)> at [8,319] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) TextNode <#text> (not painted) FieldSetBox

at [10,353] [0+2+0 780 0+2+0] [0+34+0 18 0+2+16] [BFC] children: not-inline - BlockContainer <(anonymous)> at [10,353] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) LegendBox at [18,327] [8+0+0 61.015625 0+0+8] [8+0+0 18 0+0+8] children: inline frag 0 from TextNode start: 0, length: 7, rect: [18,327 61.015625x18] baseline: 13.796875 "Margins" TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,353] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) - BlockContainer

at [10,353] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] children: inline - frag 0 from TextNode start: 0, length: 7, rect: [10,353 62.328125x18] baseline: 13.796875 - "Content" - TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,371] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,353] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [10,353] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,353] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer

at [10,353] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [10,353 62.328125x18] baseline: 13.796875 + "Content" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,371] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) BlockContainer <(anonymous)> at [8,389] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) TextNode <#text> (not painted) FieldSetBox

at [10,461] [0+2+0 50 0+2+730] [0+72+0 18 0+2+16] [BFC] children: not-inline - BlockContainer <(anonymous)> at [10,461] [0+0+0 50 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) LegendBox at [10,389] [0+0+0 50 0+0+0] [0+0+0 72 0+0+0] children: inline frag 0 from TextNode start: 0, length: 4, rect: [10,389 38.390625x18] baseline: 13.796875 "Long" @@ -122,50 +126,55 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children frag 3 from TextNode start: 17, length: 4, rect: [10,443 35.5625x18] baseline: 13.796875 "here" TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,461] [0+0+0 50 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) - BlockContainer

at [10,461] [0+0+0 50 0+0+0] [0+0+0 18 0+0+0] children: inline - frag 0 from TextNode start: 0, length: 7, rect: [10,461 62.328125x18] baseline: 13.796875 - "Content" - TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,479] [0+0+0 50 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,461] [0+0+0 50 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [10,461] [0+0+0 50 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,461] [0+0+0 50 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer

at [10,461] [0+0+0 50 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [10,461 62.328125x18] baseline: 13.796875 + "Content" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,479] [0+0+0 50 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) BlockContainer <(anonymous)> at [8,497] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) TextNode <#text> (not painted) FieldSetBox

at [10,515] [0+2+0 780 0+2+0] [0+18+0 18 0+2+16] [BFC] children: not-inline - BlockContainer <(anonymous)> at [10,515] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) LegendBox at [10,497] [0+0+0 200 0+0+580] [0+0+0 18 0+0+0] children: inline frag 0 from TextNode start: 0, length: 11, rect: [10,497 91.1875x18] baseline: 13.796875 "Fixed width" TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,515] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) - BlockContainer

at [10,515] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] children: inline - frag 0 from TextNode start: 0, length: 7, rect: [10,515 62.328125x18] baseline: 13.796875 - "Content" - TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,533] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,515] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [10,515] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,515] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer

at [10,515] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [10,515 62.328125x18] baseline: 13.796875 + "Content" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,533] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) BlockContainer <(anonymous)> at [8,551] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) TextNode <#text> (not painted) FieldSetBox

at [30,589] [0+2+20 740 20+2+0] [0+18+20 18 20+2+16] [BFC] children: not-inline - BlockContainer <(anonymous)> at [30,589] [0+0+0 740 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) LegendBox at [30,551] [0+0+0 117.90625 0+0+0] [0+0+0 18 0+0+0] children: inline frag 0 from TextNode start: 0, length: 15, rect: [30,551 117.90625x18] baseline: 13.796875 "Padded fieldset" TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [30,589] [0+0+0 740 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) - BlockContainer

at [30,589] [0+0+0 740 0+0+0] [0+0+0 18 0+0+0] children: inline - frag 0 from TextNode start: 0, length: 7, rect: [30,589 62.328125x18] baseline: 13.796875 - "Content" - TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [30,607] [0+0+0 740 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [30,589] [0+0+0 740 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [30,589] [0+0+0 740 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [30,589] [0+0+0 740 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer

at [30,589] [0+0+0 740 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [30,589 62.328125x18] baseline: 13.796875 + "Content" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [30,607] [0+0+0 740 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) BlockContainer <(anonymous)> at [8,645] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) TextNode <#text> (not painted) @@ -204,106 +213,129 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children TextNode <#text> (not painted) TextNode <#text> (not painted) FieldSetBox

at [10,739] [0+2+0 780 0+2+0] [0+18+0 18 0+2+16] [BFC] children: not-inline - BlockContainer <(anonymous)> at [10,739] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) - BlockContainer

at [10,739] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] children: inline - frag 0 from TextNode start: 0, length: 12, rect: [10,739 99.546875x18] baseline: 13.796875 - "Not a legend" - TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,757] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) LegendBox at [10,721] [0+0+0 134.5 0+0+0] [0+0+0 18 0+0+0] children: inline frag 0 from TextNode start: 0, length: 15, rect: [10,721 134.5x18] baseline: 13.796875 "After paragraph" TextNode <#text> (not painted) - BlockContainer <(anonymous)> at [10,757] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline - TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,739] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [10,739] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer

at [10,739] [0+0+0 780 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 12, rect: [10,739 99.546875x18] baseline: 13.796875 + "Not a legend" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,757] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,757] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) BlockContainer <(anonymous)> at [8,775] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) + TextNode <#text> (not painted) + FieldSetBox

at [10,793] [0+2+0 780 0+2+0] [0+18+0 0 0+2+16] [BFC] children: not-inline + LegendBox at [10,775] [0+0+0 113.8125 0+0+0] [0+0+0 18 0+0+0] children: inline + frag 0 from TextNode start: 0, length: 13, rect: [10,775 113.8125x18] baseline: 13.796875 + "Overflow auto" + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,793] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline + BlockContainer <(anonymous)> at [10,793] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [10,793] [0+0+0 780 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [8,811] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline + TextNode <#text> (not painted) -ViewportPaintable (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x775] - PaintableWithLines (BlockContainer) [0,0 800x775] - PaintableWithLines (BlockContainer) [8,8 784x751] +ViewportPaintable (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x811] + PaintableWithLines (BlockContainer) [0,0 800x811] + PaintableWithLines (BlockContainer) [8,8 784x787] FieldSetPaintable (FieldSetBox
) [8,8 784x38] - PaintableWithLines (BlockContainer(anonymous)) [10,26 780x0] PaintableWithLines (LegendBox) [10,8 56.5x18] TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,26 780x0] - PaintableWithLines (BlockContainer

) [10,26 780x18] - TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,44 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,26 780x18] + PaintableWithLines (BlockContainer(anonymous)) [10,26 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,26 780x0] + PaintableWithLines (BlockContainer

) [10,26 780x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [10,44 780x0] PaintableWithLines (BlockContainer(anonymous)) [8,62 784x0] FieldSetPaintable (FieldSetBox

) [8,62 784x36] - PaintableWithLines (BlockContainer(anonymous)) [8,80 784x0] PaintableWithLines (LegendBox) [8,62 82.703125x18] TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [8,80 784x0] - PaintableWithLines (BlockContainer

) [8,80 784x18] - TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [8,98 784x0] + PaintableWithLines (BlockContainer(anonymous)) [8,80 784x18] + PaintableWithLines (BlockContainer(anonymous)) [8,80 784x0] + PaintableWithLines (BlockContainer(anonymous)) [8,80 784x0] + PaintableWithLines (BlockContainer

) [8,80 784x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [8,98 784x0] PaintableWithLines (BlockContainer(anonymous)) [8,114 784x0] FieldSetPaintable (FieldSetBox

) [8,114 784x41] - PaintableWithLines (BlockContainer(anonymous)) [13,132 774x0] PaintableWithLines (LegendBox) [13,114 104.828125x18] TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [13,132 774x0] - PaintableWithLines (BlockContainer

) [13,132 774x18] - TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [13,150 774x0] + PaintableWithLines (BlockContainer(anonymous)) [13,132 774x18] + PaintableWithLines (BlockContainer(anonymous)) [13,132 774x0] + PaintableWithLines (BlockContainer(anonymous)) [13,132 774x0] + PaintableWithLines (BlockContainer

) [13,132 774x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [13,150 774x0] PaintableWithLines (BlockContainer(anonymous)) [8,171 784x0] FieldSetPaintable (FieldSetBox

) [8,171 784x58] - PaintableWithLines (BlockContainer(anonymous)) [10,209 780x0] PaintableWithLines (LegendBox) [10,171 104.8125x38] TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,209 780x0] - PaintableWithLines (BlockContainer

) [10,209 780x18] - TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,227 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,209 780x18] + PaintableWithLines (BlockContainer(anonymous)) [10,209 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,209 780x0] + PaintableWithLines (BlockContainer

) [10,209 780x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [10,227 780x0] PaintableWithLines (BlockContainer(anonymous)) [8,245 784x0] FieldSetPaintable (FieldSetBox

) [8,245 784x58] - PaintableWithLines (BlockContainer(anonymous)) [28,265 744x0] PaintableWithLines (LegendBox) [28,246 202.90625x18] TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [28,265 744x0] - PaintableWithLines (BlockContainer

) [28,265 744x18] - TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [28,283 744x0] + PaintableWithLines (BlockContainer(anonymous)) [28,265 744x18] + PaintableWithLines (BlockContainer(anonymous)) [28,265 744x0] + PaintableWithLines (BlockContainer(anonymous)) [28,265 744x0] + PaintableWithLines (BlockContainer

) [28,265 744x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [28,283 744x0] PaintableWithLines (BlockContainer(anonymous)) [8,319 784x0] FieldSetPaintable (FieldSetBox

) [8,319 784x54] - PaintableWithLines (BlockContainer(anonymous)) [10,353 780x0] PaintableWithLines (LegendBox) [18,327 61.015625x18] TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,353 780x0] - PaintableWithLines (BlockContainer

) [10,353 780x18] - TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,371 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,353 780x18] + PaintableWithLines (BlockContainer(anonymous)) [10,353 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,353 780x0] + PaintableWithLines (BlockContainer

) [10,353 780x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [10,371 780x0] PaintableWithLines (BlockContainer(anonymous)) [8,389 784x0] FieldSetPaintable (FieldSetBox

) [8,389 54x92] - PaintableWithLines (BlockContainer(anonymous)) [10,461 50x0] PaintableWithLines (LegendBox) [10,389 50x72] TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,461 50x0] - PaintableWithLines (BlockContainer

) [10,461 50x18] - TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,479 50x0] + PaintableWithLines (BlockContainer(anonymous)) [10,461 50x18] + PaintableWithLines (BlockContainer(anonymous)) [10,461 50x0] + PaintableWithLines (BlockContainer(anonymous)) [10,461 50x0] + PaintableWithLines (BlockContainer

) [10,461 50x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [10,479 50x0] PaintableWithLines (BlockContainer(anonymous)) [8,497 784x0] FieldSetPaintable (FieldSetBox

) [8,497 784x38] - PaintableWithLines (BlockContainer(anonymous)) [10,515 780x0] PaintableWithLines (LegendBox) [10,497 200x18] TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,515 780x0] - PaintableWithLines (BlockContainer

) [10,515 780x18] - TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,533 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,515 780x18] + PaintableWithLines (BlockContainer(anonymous)) [10,515 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,515 780x0] + PaintableWithLines (BlockContainer

) [10,515 780x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [10,533 780x0] PaintableWithLines (BlockContainer(anonymous)) [8,551 784x0] FieldSetPaintable (FieldSetBox

) [8,551 784x78] - PaintableWithLines (BlockContainer(anonymous)) [30,589 740x0] PaintableWithLines (LegendBox) [30,551 117.90625x18] TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [30,589 740x0] - PaintableWithLines (BlockContainer

) [30,589 740x18] - TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [30,607 740x0] + PaintableWithLines (BlockContainer(anonymous)) [30,589 740x18] + PaintableWithLines (BlockContainer(anonymous)) [30,589 740x0] + PaintableWithLines (BlockContainer(anonymous)) [30,589 740x0] + PaintableWithLines (BlockContainer

) [30,589 740x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [30,607 740x0] PaintableWithLines (BlockContainer(anonymous)) [8,645 784x0] FieldSetPaintable (FieldSetBox

) [8,645 784x22] PaintableWithLines (BlockContainer(anonymous)) [10,647 780x0] @@ -322,14 +354,22 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x775] PaintableWithLines (BlockContainer(anonymous)) [10,703 780x0] PaintableWithLines (BlockContainer(anonymous)) [8,721 784x0] FieldSetPaintable (FieldSetBox
) [8,721 784x38] - PaintableWithLines (BlockContainer(anonymous)) [10,739 780x0] - PaintableWithLines (BlockContainer

) [10,739 780x18] - TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,757 780x0] PaintableWithLines (LegendBox) [10,721 134.5x18] TextPaintable (TextNode<#text>) - PaintableWithLines (BlockContainer(anonymous)) [10,757 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,739 780x18] + PaintableWithLines (BlockContainer(anonymous)) [10,739 780x0] + PaintableWithLines (BlockContainer

) [10,739 780x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [10,757 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,757 780x0] PaintableWithLines (BlockContainer(anonymous)) [8,775 784x0] + FieldSetPaintable (FieldSetBox

) [8,775 784x20] + PaintableWithLines (LegendBox) [10,775 113.8125x18] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [10,793 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,793 780x0] + PaintableWithLines (BlockContainer(anonymous)) [10,793 780x0] + PaintableWithLines (BlockContainer(anonymous)) [8,811 784x0] SC for Viewport<#document> [0,0 800x600] [children: 1] (z-index: auto) - SC for BlockContainer [0,0 800x775] [children: 0] (z-index: auto) + SC for BlockContainer [0,0 800x811] [children: 0] (z-index: auto) diff --git a/Tests/LibWeb/Layout/expected/fieldset-with-rendered-legend.txt b/Tests/LibWeb/Layout/expected/fieldset-with-rendered-legend.txt index a23f998588..ce78a85b58 100644 --- a/Tests/LibWeb/Layout/expected/fieldset-with-rendered-legend.txt +++ b/Tests/LibWeb/Layout/expected/fieldset-with-rendered-legend.txt @@ -6,6 +6,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children frag 0 from TextNode start: 0, length: 5, rect: [26,8 36.328125x18] baseline: 13.796875 "login" TextNode <#text> (not painted) + BlockContainer <(anonymous)> at [24,31.59375] [0+0+0 752 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline BlockContainer <(anonymous)> at [8,43.59375] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline TextNode <#text> (not painted) @@ -15,6 +16,7 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] FieldSetPaintable (FieldSetBox
) [10,8 780x35.59375] PaintableWithLines (LegendBox) [24,8 40.328125x18] TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer(anonymous)) [24,31.59375 752x0] PaintableWithLines (BlockContainer(anonymous)) [8,43.59375 784x0] SC for Viewport<#document> [0,0 800x600] [children: 1] (z-index: auto) diff --git a/Tests/LibWeb/Layout/input/fieldset-legend-variations.html b/Tests/LibWeb/Layout/input/fieldset-legend-variations.html index b5e0f15bda..42ff9bbb9d 100644 --- a/Tests/LibWeb/Layout/input/fieldset-legend-variations.html +++ b/Tests/LibWeb/Layout/input/fieldset-legend-variations.html @@ -87,3 +87,8 @@ p { After paragraph
+ +
+ Overflow auto +
+