Bug 1420178 - Add assertion to ensure the custom element reactions aren't scheduled to BackupQueue if they are from author code; draft
authorEdgar Chen <echen@mozilla.com>
Tue, 05 Dec 2017 17:56:57 +0800
changeset 718319 a13358cafffc2c0dd54241ce93c9fed7669e38f9
parent 718318 a9dfe67e34c6fa20087d742050cbd0858f4c1c04
child 718891 cd6de134e4c9d982b3669a1a9303281eba83d627
push id94878
push userechen@mozilla.com
push dateWed, 10 Jan 2018 02:51:10 +0000
bugs1420178
milestone59.0a1
Bug 1420178 - Add assertion to ensure the custom element reactions aren't scheduled to BackupQueue if they are from author code; MozReview-Commit-ID: BSna1j1NBSX
dom/base/CustomElementRegistry.cpp
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -1056,16 +1056,18 @@ CustomElementReactionsStack::Enqueue(Ele
     elementData->mReactionQueue.AppendElement(aReaction);
     return;
   }
 
   // If the custom element reactions stack is empty, then:
   // Add element to the backup element queue.
   MOZ_ASSERT(mReactionsStack.IsEmpty(),
              "custom element reactions stack should be empty");
+  MOZ_ASSERT(!GetIncumbentGlobal(),
+             "Custom element reaction should not be scheduled to backup queue if it is from author code");
   MOZ_ASSERT(!aReaction->IsUpgradeReaction(),
              "Upgrade reaction should not be scheduled to backup queue");
   mBackupQueue.AppendElement(aElement);
   elementData->mReactionQueue.AppendElement(aReaction);
 
   if (mIsBackupQueueProcessing) {
     return;
   }