diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-06-27 16:00:53 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-27 16:00:53 +0200 |
commit | 8b71cda1956ab640ad76bea36e7971476aa78bcf (patch) | |
tree | c369019586632332b2627225eb7f6adab1e285d8 /dom/base/FragmentOrElement.cpp | |
parent | 9168a0fc95f523c7c852ca95969edb39069f4a03 (diff) | |
download | uxp-8b71cda1956ab640ad76bea36e7971476aa78bcf.tar.gz |
Stabilize and align Intersection Observers
- Fixes several crashes
- Aligns the feature with the W3C WD spec
Tag #249
Diffstat (limited to 'dom/base/FragmentOrElement.cpp')
-rw-r--r-- | dom/base/FragmentOrElement.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index b22a0d4ffa..fde983e7cb 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -608,6 +608,7 @@ FragmentOrElement::nsDOMSlots::Unlink(bool aIsXUL) mLabelsList = nullptr; mCustomElementData = nullptr; mClassList = nullptr; + mRegisteredIntersectionObservers.Clear(); } size_t @@ -1359,6 +1360,13 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement) { nsDOMSlots *slots = tmp->GetExistingDOMSlots(); if (slots) { + if (tmp->IsElement()) { + Element* elem = tmp->AsElement(); + for (auto iter = slots->mRegisteredIntersectionObservers.Iter(); !iter.Done(); iter.Next()) { + DOMIntersectionObserver* observer = iter.Key(); + observer->UnlinkTarget(*elem); + } + } slots->Unlink(tmp->IsXULElement()); } } |