summaryrefslogtreecommitdiff
path: root/dom/base/FragmentOrElement.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-05 15:31:44 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:27 -0500
commit8573c572fbf5fa68defb3228e7f1450ec234d59b (patch)
tree97c6eefe6718d62d901155eca3badbfec67eebb0 /dom/base/FragmentOrElement.cpp
parentf50503df9c2eced785957626273ee07e5312d546 (diff)
downloaduxp-8573c572fbf5fa68defb3228e7f1450ec234d59b.tar.gz
Bug 1392970 - Part 1: Make CustomElementDefinition ref-counted and put it in CustomElementData.
Tag UXP Issue #1344
Diffstat (limited to 'dom/base/FragmentOrElement.cpp')
-rw-r--r--dom/base/FragmentOrElement.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp
index e341ae315b..a851190ff6 100644
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -589,6 +589,13 @@ FragmentOrElement::nsDOMSlots::Traverse(nsCycleCollectionTraversalCallback &cb)
mExtendedSlots->mCustomElementData->mReactionQueue[i]->Traverse(cb);
}
}
+
+ if (mExtendedSlots->mCustomElementData->mCustomElementDefinition) {
+ NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb,
+ "mExtendedSlots->mCustomElementData->mCustomElementDefinition");
+ cb.NoteNativeChild(mExtendedSlots->mCustomElementData->mCustomElementDefinition,
+ NS_CYCLE_COLLECTION_PARTICIPANT(CustomElementDefinition));
+ }
}
for (auto iter = mExtendedSlots->mRegisteredIntersectionObservers.Iter();
@@ -625,7 +632,12 @@ FragmentOrElement::nsDOMSlots::Unlink()
mExtendedSlots->mContainingShadow = nullptr;
MOZ_ASSERT(!(mExtendedSlots->mXBLBinding));
mExtendedSlots->mXBLInsertionParent = nullptr;
- mExtendedSlots->mCustomElementData = nullptr;
+ if (mExtendedSlots->mCustomElementData) {
+ if (mExtendedSlots->mCustomElementData->mCustomElementDefinition) {
+ mExtendedSlots->mCustomElementData->mCustomElementDefinition = nullptr;
+ }
+ mExtendedSlots->mCustomElementData = nullptr;
+ }
mExtendedSlots->mRegisteredIntersectionObservers.Clear();
nsCOMPtr<nsIFrameLoader> frameLoader =
do_QueryInterface(mExtendedSlots->mFrameLoaderOrOpener);