LibWeb: Don't throw away UA shadow trees willy-nilly

We were unnecessarily discarding the shadow trees of various elements
when they were removed or detached from the DOM.

This especially caused a *lot* of churn when creating input elements via
setting .innerHTML on something. We ended up building each input
element's shadow tree 3 times instead of 1.

The original issue that we were trying to solve by discarding shadow
trees appears to have been solved elsewhere, and nothing else seems to
break by just allowing them to remain in place.

1.05x speedup on Speedometer's TodoMVC-jQuery.
This commit is contained in:
Andreas Kling 2025-05-09 15:35:59 +02:00 committed by Tim Flynn
parent 123abe0e79
commit f61df9d34c
Notes: github-actions[bot] 2025-05-09 16:50:05 +00:00
12 changed files with 0 additions and 39 deletions

View file

@ -35,7 +35,6 @@ public:
// ^HTMLElement
virtual void inserted() override;
virtual void removed_from(DOM::Node* old_parent, DOM::Node& old_root) override;
virtual void adjust_computed_style(CSS::ComputedProperties&) override;