summaryrefslogtreecommitdiff
path: root/dom/base/FragmentOrElement.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-18 20:35:11 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:39 -0500
commitb7f890e02e6bf24db172881d6da910e70c7586fe (patch)
treebd9598a66bbd5f9a52fc51c291bc0dd2c8507856 /dom/base/FragmentOrElement.cpp
parentfce396323da02695c266579d229f11bf0959280b (diff)
downloaduxp-b7f890e02e6bf24db172881d6da910e70c7586fe.tar.gz
Bug 1410790 - Add more assertion in CustomElementData::SetCustomElementDefinition and GetCustomElementDefinition;
This is a follow-up patch for bug 1392970. Since we only set CustomElementDefinition on a custom element which is custom, we could add more assertion to ensure that. Tag UXP Issue #1344
Diffstat (limited to 'dom/base/FragmentOrElement.cpp')
-rw-r--r--dom/base/FragmentOrElement.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp
index a851190ff6..526c3c9d44 100644
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -583,19 +583,7 @@ FragmentOrElement::nsDOMSlots::Traverse(nsCycleCollectionTraversalCallback &cb)
cb.NoteXPCOMChild(mExtendedSlots->mXBLInsertionParent.get());
if (mExtendedSlots->mCustomElementData) {
- for (uint32_t i = 0;
- i < mExtendedSlots->mCustomElementData->mReactionQueue.Length(); i++) {
- if (mExtendedSlots->mCustomElementData->mReactionQueue[i]) {
- 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));
- }
+ mExtendedSlots->mCustomElementData->Traverse(cb);
}
for (auto iter = mExtendedSlots->mRegisteredIntersectionObservers.Iter();
@@ -633,9 +621,7 @@ FragmentOrElement::nsDOMSlots::Unlink()
MOZ_ASSERT(!(mExtendedSlots->mXBLBinding));
mExtendedSlots->mXBLInsertionParent = nullptr;
if (mExtendedSlots->mCustomElementData) {
- if (mExtendedSlots->mCustomElementData->mCustomElementDefinition) {
- mExtendedSlots->mCustomElementData->mCustomElementDefinition = nullptr;
- }
+ mExtendedSlots->mCustomElementData->Unlink();
mExtendedSlots->mCustomElementData = nullptr;
}
mExtendedSlots->mRegisteredIntersectionObservers.Clear();