LibWeb: Never split <svg> for inline continuations

This fixes an issue where we'd make an absolute mess from nested SVG
roots with display:block. Before this fix, the inner SVG root would
trigger the inline continuation logic and try to split the tree.
This commit is contained in:
Andreas Kling 2025-07-12 13:54:24 +02:00 committed by Jelle Raaijmakers
parent 4e23882995
commit 8e49b69f42
Notes: github-actions[bot] 2025-07-12 12:12:47 +00:00
3 changed files with 25 additions and 6 deletions

View file

@ -1444,12 +1444,8 @@ bool NodeWithStyleAndBoxModelMetrics::should_create_inline_continuation() const
if (is<SVG::SVGForeignObjectElement>(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;