diff --git a/Tests/LibWeb/Layout/expected/svg-transforms-and-viewboxes.txt b/Tests/LibWeb/Layout/expected/svg-transforms-and-viewboxes.txt index 7c5e39e2db..d9619cf222 100644 --- a/Tests/LibWeb/Layout/expected/svg-transforms-and-viewboxes.txt +++ b/Tests/LibWeb/Layout/expected/svg-transforms-and-viewboxes.txt @@ -21,12 +21,12 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline frag 0 from SVGSVGBox start: 0, length: 0, rect: [50,450 200x200] SVGSVGBox at (50,150) content-size 200x100 [SVG] children: inline TextNode <#text> - SVGGraphicsBox (not painted) children: inline + SVGGraphicsBox at (50,150) content-size 0x0 children: inline TextNode <#text> SVGGeometryBox at (45.693222,199.830932) content-size 118.782173x47.453796 children: not-inline TextNode <#text> TextNode <#text> - SVGGraphicsBox (not painted) children: inline + SVGGraphicsBox at (50,150) content-size 0x0 children: inline TextNode <#text> SVGGeometryBox at (84.5,159.504878) content-size 81x80.995117 children: not-inline TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/svg/svg-inside-svg.txt b/Tests/LibWeb/Layout/expected/svg/svg-inside-svg.txt index e7fab52694..4931416a77 100644 --- a/Tests/LibWeb/Layout/expected/svg/svg-inside-svg.txt +++ b/Tests/LibWeb/Layout/expected/svg/svg-inside-svg.txt @@ -4,7 +4,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline line 0 width: 24, height: 24, bottom: 24, baseline: 24 frag 0 from SVGSVGBox start: 0, length: 0, rect: [8,8 24x24] SVGSVGBox at (8,8) content-size 24x24 [SVG] children: inline - SVGGraphicsBox (not painted) children: inline + SVGGraphicsBox at (8,8) content-size 0x0 children: inline SVGSVGBox at (8,8) content-size 24x24 [SVG] children: not-inline SVGGeometryBox at (8,8) content-size 24x24 children: not-inline TextNode <#text> diff --git a/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp index 31ff3ca003..4d6f35caf6 100644 --- a/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/SVGFormattingContext.cpp @@ -192,6 +192,11 @@ void SVGFormattingContext::run(Box const& box, LayoutMode layout_mode, Available auto const& svg_text_box = static_cast(descendant); // NOTE: This hack creates a layout state to ensure the existence of a paintable box node in LayoutState::commit(), even when none of the values from UsedValues impact the SVG text. m_state.get_mutable(svg_text_box); + } else if (is(descendant)) { + // Same hack as above. + // FIXME: This should be sized based on its children. + auto const& svg_graphics_box = static_cast(descendant); + m_state.get_mutable(svg_graphics_box); } return IterationDecision::Continue;