LibWeb: Make Document::m_intersection_observers a weak mapping

These registrations are not meant to keep the observers alive.
This fixes a handful of world leaks on Speedometer.
This commit is contained in:
Andreas Kling 2024-11-11 16:31:24 +01:00 committed by Andreas Kling
commit b397a0d535
Notes: github-actions[bot] 2024-11-11 20:41:59 +00:00
2 changed files with 10 additions and 4 deletions

View file

@ -939,8 +939,8 @@ private:
JS::GCPtr<CSS::VisualViewport> m_visual_viewport;
// NOTE: Not in the spec per say, but Document must be able to access all IntersectionObservers whose root is in the document.
OrderedHashTable<JS::NonnullGCPtr<IntersectionObserver::IntersectionObserver>> m_intersection_observers;
// NOTE: Not in the spec per se, but Document must be able to access all IntersectionObservers whose root is in the document.
IGNORE_GC OrderedHashTable<JS::NonnullGCPtr<IntersectionObserver::IntersectionObserver>> m_intersection_observers;
// https://www.w3.org/TR/intersection-observer/#document-intersectionobservertaskqueued
// Each document has an IntersectionObserverTaskQueued flag which is initialized to false.