summaryrefslogtreecommitdiff
path: root/dom/base/DOMIntersectionObserver.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-12-24 01:58:16 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-12-24 01:58:16 +0100
commit3cf7e874fecf940ffeec00bafd3cf96d5c1b2a46 (patch)
treef32ef71a8d6a2831ff3646665a2cecc8a8945d1c /dom/base/DOMIntersectionObserver.h
parentbfedd7d40c73ef0423251f6df74bc948a6f44a1e (diff)
downloaduxp-3cf7e874fecf940ffeec00bafd3cf96d5c1b2a46.tar.gz
Fix crashiness of IntersectionObservers.
Mozilla hashtables -still- suck.
Diffstat (limited to 'dom/base/DOMIntersectionObserver.h')
-rw-r--r--dom/base/DOMIntersectionObserver.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/dom/base/DOMIntersectionObserver.h b/dom/base/DOMIntersectionObserver.h
index c290002ea5..9c8ebf5b12 100644
--- a/dom/base/DOMIntersectionObserver.h
+++ b/dom/base/DOMIntersectionObserver.h
@@ -145,7 +145,7 @@ public:
void Observe(Element& aTarget);
void Unobserve(Element& aTarget);
- bool UnlinkTarget(Element& aTarget);
+ void UnlinkTarget(Element& aTarget);
void Disconnect();
void TakeRecords(nsTArray<RefPtr<DOMIntersectionObserverEntry>>& aRetVal);
@@ -172,7 +172,10 @@ protected:
RefPtr<Element> mRoot;
nsCSSRect mRootMargin;
nsTArray<double> mThresholds;
- nsTHashtable<nsPtrHashKey<Element>> mObservationTargets;
+
+ // Holds raw pointers which are explicitly cleared by UnlinkTarget().
+ nsTArray<Element*> mObservationTargets;
+
nsTArray<RefPtr<DOMIntersectionObserverEntry>> mQueuedEntries;
bool mConnected;
};