summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-05 18:48:51 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:32 -0500
commit3da8bf41cd92110f1b62be7700207e5be05b3ca7 (patch)
tree5a7aeb155136a1cfc133ce37702e231c87a8e7be /dom
parentcc05c715a78fdf33f6b519527cf1118e6fb79ae8 (diff)
downloadaura-central-3da8bf41cd92110f1b62be7700207e5be05b3ca7.tar.gz
Bug 1352290 - Add assertion to CustomElementReactionsStack::Enqueue to ensure upgrade reactions aren't scheduled to BackupQueue;
Tag UXP Issue mcp-graveyard/UXP%1344
Diffstat (limited to 'dom')
-rw-r--r--dom/base/CustomElementRegistry.cpp2
-rw-r--r--dom/base/CustomElementRegistry.h13
2 files changed, 15 insertions, 0 deletions
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index fc6ac2877..200668f9e 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -1045,6 +1045,8 @@ CustomElementReactionsStack::Enqueue(Element* aElement,
// If the custom element reactions stack is empty, then:
// Add element to the backup element queue.
+ MOZ_ASSERT(!aReaction->IsUpgradeReaction(),
+ "Upgrade reaction should not be scheduled to backup queue");
mBackupQueue.AppendElement(aElement);
elementData->mReactionQueue.AppendElement(aReaction);
diff --git a/dom/base/CustomElementRegistry.h b/dom/base/CustomElementRegistry.h
index 674c653ab..867c92647 100644
--- a/dom/base/CustomElementRegistry.h
+++ b/dom/base/CustomElementRegistry.h
@@ -217,6 +217,16 @@ public:
virtual void Traverse(nsCycleCollectionTraversalCallback& aCb) const
{
}
+
+#if DEBUG
+ bool IsUpgradeReaction()
+ {
+ return mIsUpgradeReaction;
+ }
+
+protected:
+ bool mIsUpgradeReaction = false;
+#endif
};
class CustomElementUpgradeReaction final : public CustomElementReaction
@@ -225,6 +235,9 @@ public:
explicit CustomElementUpgradeReaction(CustomElementDefinition* aDefinition)
: mDefinition(aDefinition)
{
+#if DEBUG
+ mIsUpgradeReaction = true;
+#endif
}
private: