LibWeb: Factor out a method to update the cached elements

This is useful for any function which is needing to read the from the
cache, instead of onl using `collect_matching_elements`.
This commit is contained in:
Shannon Booth 2024-04-01 15:08:22 +02:00 committed by Andreas Kling
commit cdd0038c9e
Notes: sideshowbarker 2024-07-16 17:05:37 +09:00
2 changed files with 26 additions and 18 deletions

View file

@ -56,6 +56,8 @@ protected:
private:
virtual void visit_edges(Cell::Visitor&) override;
void update_cache_if_needed() const;
mutable u64 m_cached_dom_tree_version { 0 };
mutable Vector<JS::NonnullGCPtr<Element>> m_cached_elements;