LibWeb: Cache and reuse inline style for text input shadow trees

Instead of reparsing the style attributes every time we instantiate
the internal shadow tree for a text input element, we now parse them
once (in the internal CSS realm) and reuse them for all elements.

Roughly a ~10% speedup on Speedometer 2.1 :^)
This commit is contained in:
Andreas Kling 2025-03-25 11:48:54 +00:00 committed by Andreas Kling
commit d856858015
Notes: github-actions[bot] 2025-03-25 23:57:59 +00:00
3 changed files with 69 additions and 28 deletions

View file

@ -925,6 +925,12 @@ GC::Ref<CSS::CSSStyleProperties> Element::style_for_bindings()
return *m_inline_style;
}
void Element::set_inline_style(GC::Ptr<CSS::CSSStyleProperties> style)
{
m_inline_style = style;
set_needs_style_update(true);
}
// https://dom.spec.whatwg.org/#element-html-uppercased-qualified-name
void Element::make_html_uppercased_qualified_name()
{