summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-22 21:22:36 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:50 -0500
commita8bf089e8aa0e8f552ece98f14910b3fc21dc0c5 (patch)
tree231e5c2758465d43cd9b9f47a01d244a3a8494e6 /dom
parent0405d843be4889da2a489eb2d573855589ab874e (diff)
downloadUXP-a8bf089e8aa0e8f552ece98f14910b3fc21dc0c5.tar
UXP-a8bf089e8aa0e8f552ece98f14910b3fc21dc0c5.tar.gz
UXP-a8bf089e8aa0e8f552ece98f14910b3fc21dc0c5.tar.lz
UXP-a8bf089e8aa0e8f552ece98f14910b3fc21dc0c5.tar.xz
UXP-a8bf089e8aa0e8f552ece98f14910b3fc21dc0c5.zip
Bug 1419305 - Part 2: Keep processing remaining elements in ElementQueue even if some of elements are already unlinked
Tag UXP Issue #1344
Diffstat (limited to 'dom')
-rw-r--r--dom/base/CustomElementRegistry.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index 55e2d3b30..761a79113 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -1034,6 +1034,8 @@ CustomElementReactionsStack::InvokeBackupQueue()
// we don't need to pass global object for error reporting.
InvokeReactions(&mBackupQueue, nullptr);
}
+ MOZ_ASSERT(mBackupQueue.IsEmpty(),
+ "There are still some reactions in BackupQueue not being consumed!?!");
}
void
@@ -1050,15 +1052,14 @@ CustomElementReactionsStack::InvokeReactions(ElementQueue* aElementQueue,
for (uint32_t i = 0; i < aElementQueue->Length(); ++i) {
Element* element = aElementQueue->ElementAt(i);
- if (!element) {
- continue;
- }
+ // ElementQueue hold a element's strong reference, it should not be a nullptr.
+ MOZ_ASSERT(element);
RefPtr<CustomElementData> elementData = element->GetCustomElementData();
if (!elementData) {
// This happens when the document is destroyed and the element is already
// unlinked, no need to fire the callbacks in this case.
- return;
+ continue;
}
auto& reactions = elementData->mReactionQueue;