From 2b020e9bbbc54f9c1bb44ef94a8e4382ca0a6558 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 13 Mar 2018 00:59:23 -0400 Subject: Bug 1444231 - Fix QI implementation for FragmentOrElement. r=mccr8, a=RyanVM MozReview-Commit-ID: 9mPO2ezk2Y7 --HG-- extra : source : 060024fa93121d878d27f329c959757e6f71017a extra : intermediate-source : 925d5693c5a1a73806062947b18c98ed13efc6c3 --- dom/base/FragmentOrElement.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'dom/base/FragmentOrElement.cpp') diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index 79f6cff51..b22a0d4ff 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -1937,7 +1937,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_INTERFACE_MAP_BEGIN(FragmentOrElement) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(FragmentOrElement) - NS_INTERFACE_MAP_ENTRY(Element) NS_INTERFACE_MAP_ENTRY(nsIContent) NS_INTERFACE_MAP_ENTRY(nsINode) NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget) -- cgit v1.2.3 From 8b71cda1956ab640ad76bea36e7971476aa78bcf Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 27 Jun 2018 16:00:53 +0200 Subject: Stabilize and align Intersection Observers - Fixes several crashes - Aligns the feature with the W3C WD spec Tag #249 --- dom/base/FragmentOrElement.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dom/base/FragmentOrElement.cpp') diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index b22a0d4ff..fde983e7c 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()); } } -- cgit v1.2.3