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

@ -213,6 +213,7 @@ public:
GC::Ptr<CSS::CSSStyleProperties> inline_style() { return m_inline_style; }
GC::Ptr<CSS::CSSStyleProperties const> inline_style() const { return m_inline_style; }
void set_inline_style(GC::Ptr<CSS::CSSStyleProperties>);
GC::Ref<CSS::CSSStyleProperties> style_for_bindings();