Bug 1352290 - Add assertion to CustomElementReactionsStack::Enqueue to ensure upgrade reactions aren't scheduled to BackupQueue; r=smaug

--HG--
extra : rebase_source : 235a56f1aad0abf2e9b4fb99b7867eb3cb30d395
This commit is contained in:
Edgar Chen 2017-10-17 17:55:08 +08:00
Родитель 4fda13fafa
Коммит dc6a84b873
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -1052,6 +1052,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);

Просмотреть файл

@ -219,6 +219,16 @@ public:
virtual void Traverse(nsCycleCollectionTraversalCallback& aCb) const
{
}
#if DEBUG
bool IsUpgradeReaction()
{
return mIsUpgradeReaction;
}
protected:
bool mIsUpgradeReaction = false;
#endif
};
class CustomElementUpgradeReaction final : public CustomElementReaction
@ -227,6 +237,9 @@ public:
explicit CustomElementUpgradeReaction(CustomElementDefinition* aDefinition)
: mDefinition(aDefinition)
{
#if DEBUG
mIsUpgradeReaction = true;
#endif
}
private: