mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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:
Notes:
github-actions[bot]
2025-05-09 16:50:05 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/f61df9d34cb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4673 Reviewed-by: https://github.com/trflynn89 ✅
@@ -175,12 +175,6 @@ void HTMLMeterElement::inserted()
|
||||
create_shadow_tree_if_needed();
|
||||
}
|
||||
|
||||
void HTMLMeterElement::removed_from(DOM::Node* old_parent, DOM::Node& old_root)
|
||||
{
|
||||
Base::removed_from(old_parent, old_root);
|
||||
set_shadow_root(nullptr);
|
||||
}
|
||||
|
||||
void HTMLMeterElement::adjust_computed_style(CSS::ComputedProperties& style)
|
||||
{
|
||||
// https://drafts.csswg.org/css-display-3/#unbox
|
||||
|
||||
Reference in New Issue
Block a user