Fix crashiness of IntersectionObservers.

Mozilla hashtables -still- suck.
This commit is contained in:
wolfbeast 2018-12-24 01:58:16 +01:00 • committed by Roy Tam
commit 304984a6aa
2 changed files with 25 additions and 21 deletions

View file

@ -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;
};