1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

LibWeb: Make document-level style invalidation fast

Add a flag to DOM::Document that means the whole document needs a style
update. This saves us the trouble of traversing the entire DOM to mark
all nodes as needing a style update.
This commit is contained in:
Andreas Kling 2022-03-19 18:10:59 +01:00
parent f87edd4c14
commit 0b861e0c9d
3 changed files with 18 additions and 4 deletions

View file

@ -334,6 +334,9 @@ public:
callback(*node_iterator);
}
bool needs_full_style_update() const { return m_needs_full_style_update; }
void set_needs_full_style_update(bool b) { m_needs_full_style_update = b; }
private:
explicit Document(const AK::URL&);
@ -438,6 +441,8 @@ private:
bool m_needs_layout { false };
bool m_needs_full_style_update { false };
HashTable<NodeIterator*> m_node_iterators;
};