From 4335473f7ca1218de86747a9a3774685ec61bfd7 Mon Sep 17 00:00:00 2001 From: John Dai Date: Thu, 5 Jan 2017 18:38:00 -0500 Subject: [PATCH] Bug 1309184 - Implement upgrade reaction for custom element reactions. r=wchen --HG-- extra : rebase_source : 0333c91029b6e08961e2ad0e7c04c3364cb429b5 --- dom/base/CustomElementRegistry.cpp | 186 ++++++++++++++++++++++++----- dom/base/CustomElementRegistry.h | 110 +++++++++++++++++ 2 files changed, 267 insertions(+), 29 deletions(-) diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp index 7a98ccb6eaef..a8ea178b73b4 100644 --- a/dom/base/CustomElementRegistry.cpp +++ b/dom/base/CustomElementRegistry.cpp @@ -137,6 +137,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CustomElementRegistry) cb.NoteXPCOMChild(callbacks->mDetachedCallback.Value()); } } + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWhenDefinedPromiseMap) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END @@ -238,6 +239,7 @@ CustomElementRegistry::sProcessingStack; CustomElementRegistry::CustomElementRegistry(nsPIDOMWindowInner* aWindow) : mWindow(aWindow) , mIsCustomDefinitionRunning(false) + , mIsBackupQueueProcessing(false) { mozilla::HoldJSObjects(this); @@ -503,35 +505,7 @@ CustomElementRegistry::UpgradeCandidates(JSContext* aCx, continue; } - elem->RemoveStates(NS_EVENT_STATE_UNRESOLVED); - - // Make sure that the element name matches the name in the definition. - // (e.g. a definition for x-button extending button should match - //