diff --git a/Libraries/LibWeb/Layout/Node.cpp b/Libraries/LibWeb/Layout/Node.cpp index 4680c495d89..dadbcf2960f 100644 --- a/Libraries/LibWeb/Layout/Node.cpp +++ b/Libraries/LibWeb/Layout/Node.cpp @@ -1444,12 +1444,8 @@ bool NodeWithStyleAndBoxModelMetrics::should_create_inline_continuation() const if (is(parent()->dom_node())) return false; - // SVGBoxes are appended directly to their layout parent without changing the parent's (non-)inline behavior. - if (is_svg_box()) - return false; - - // SVGForeignObjectBoxes should never be split. - if (is_svg_foreign_object_box()) + // SVG related boxes should never be split. + if (is_svg_box() || is_svg_svg_box() || is_svg_foreign_object_box()) return false; return true; diff --git a/Tests/LibWeb/Layout/expected/svg/svg-nested-svg-display-block.txt b/Tests/LibWeb/Layout/expected/svg/svg-nested-svg-display-block.txt new file mode 100644 index 00000000000..722149d1b53 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/svg/svg-nested-svg-display-block.txt @@ -0,0 +1,18 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x66 [BFC] children: not-inline + BlockContainer at (8,8) content-size 784x50 children: not-inline + SVGSVGBox at (8,8) content-size 50x50 [SVG] children: not-inline + SVGGraphicsBox at (8,8) content-size 25x25 children: not-inline + SVGSVGBox at (8,8) content-size 25x25 [SVG] children: not-inline + SVGGeometryBox at (8,13) content-size 25x15 children: not-inline + +ViewportPaintable (Viewport<#document>) [0,0 800x600] + PaintableWithLines (BlockContainer) [0,0 800x66] + PaintableWithLines (BlockContainer) [8,8 784x50] + SVGSVGPaintable (SVGSVGBox#outer) [8,8 50x50] + SVGGraphicsPaintable (SVGGraphicsBox) [8,8 25x25] + SVGSVGPaintable (SVGSVGBox#inner) [8,8 25x25] + SVGPathPaintable (SVGGeometryBox) [8,13 25x15] + +SC for Viewport<#document> [0,0 800x600] [children: 1] (z-index: auto) + SC for BlockContainer [0,0 800x66] [children: 0] (z-index: auto) diff --git a/Tests/LibWeb/Layout/input/svg/svg-nested-svg-display-block.html b/Tests/LibWeb/Layout/input/svg/svg-nested-svg-display-block.html new file mode 100644 index 00000000000..74591dd03c0 --- /dev/null +++ b/Tests/LibWeb/Layout/input/svg/svg-nested-svg-display-block.html @@ -0,0 +1,5 @@ + + \ No newline at end of file