mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
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.