Files
ladybird/Tests/LibWeb/Text/expected/SVG/use-element-shadow-tree-removal.txt
Andreas Kling a64ea670fd LibWeb: Fix excessive recursion when removing SVG elements from use tree
When an SVGElement is removed from a <use> element's shadow tree, we
need to check if it was in a use element's shadow root to avoid
notifying use elements about the removal of their own clones.

The check was incorrectly using root() instead of old_root. Since the
element has already been detached when removed_from() is called,
root() no longer returns the shadow root, causing the early-return
check to fail.

This led to O(n) recursion depth when clearing a use element's shadow
tree, as each removed clone would trigger another round of
remove_all_children() on use elements referencing the same ID.
2026-01-14 11:46:23 +01:00

4 lines
104 B
Plaintext

Initial shadow children: 1
After removal shadow children: 0
PASS: No stack overflow from deep recursion