LibWeb: Don't store root as JS::Handle in IntersectionObserver

Instead, use a JS::GCPtr and visit it, to prevent GC reference cycles.
This commit is contained in:
Andreas Kling 2024-04-03 12:44:32 +02:00
commit 518cedc8f3
Notes: sideshowbarker 2024-07-16 23:59:28 +09:00
2 changed files with 16 additions and 6 deletions

View file

@ -73,7 +73,7 @@ private:
JS::GCPtr<WebIDL::CallbackType> m_callback;
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserver-root
Optional<Variant<JS::Handle<DOM::Element>, JS::Handle<DOM::Document>>> m_root;
JS::GCPtr<DOM::Node> m_root;
// https://www.w3.org/TR/intersection-observer/#dom-intersectionobserver-thresholds
Vector<double> m_thresholds;