LibWeb: Add mechanism to invalidate only inherited styles

We can now mark an element as needing an "inherited style update" rather
than a full "style update". This effectively means that the next style
update will visit the element and pull all of its inherited properties
from the relevant ancestor element.

This is now used for descendants of elements with animated style.
This commit is contained in:
Andreas Kling
2024-12-22 11:59:58 +01:00
committed by Andreas Kling
parent 92ac702c0c
commit dc8343cc23
7 changed files with 55 additions and 16 deletions

View File

@@ -275,6 +275,9 @@ public:
bool needs_style_update() const { return m_needs_style_update; }
void set_needs_style_update(bool);
bool needs_inherited_style_update() const { return m_needs_inherited_style_update; }
void set_needs_inherited_style_update(bool);
bool child_needs_style_update() const { return m_child_needs_style_update; }
void set_child_needs_style_update(bool b) { m_child_needs_style_update = b; }
@@ -746,6 +749,7 @@ protected:
GC::Ptr<Painting::Paintable> m_paintable;
NodeType m_type { NodeType::INVALID };
bool m_needs_style_update { false };
bool m_needs_inherited_style_update { false };
bool m_child_needs_style_update { false };
UniqueNodeID m_unique_id;