diff options
Diffstat (limited to 'dom/base/CustomElementRegistry.cpp')
-rw-r--r-- | dom/base/CustomElementRegistry.cpp | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp index 20eb59e94..25267f5d3 100644 --- a/dom/base/CustomElementRegistry.cpp +++ b/dom/base/CustomElementRegistry.cpp @@ -174,30 +174,6 @@ CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject) Preferences::GetBool("dom.webcomponents.enabled"); } -/* static */ already_AddRefed<CustomElementRegistry> -CustomElementRegistry::Create(nsPIDOMWindowInner* aWindow) -{ - MOZ_ASSERT(aWindow); - MOZ_ASSERT(aWindow->IsInnerWindow()); - - if (!aWindow->GetDocShell()) { - return nullptr; - } - - if (!IsCustomElementEnabled()) { - return nullptr; - } - - RefPtr<CustomElementRegistry> customElementRegistry = - new CustomElementRegistry(aWindow); - - if (!customElementRegistry->Init()) { - return nullptr; - } - - return customElementRegistry.forget(); -} - /* static */ void CustomElementRegistry::ProcessTopElementQueue() { @@ -240,6 +216,10 @@ CustomElementRegistry::CustomElementRegistry(nsPIDOMWindowInner* aWindow) , mIsCustomDefinitionRunning(false) , mIsBackupQueueProcessing(false) { + MOZ_ASSERT(aWindow); + MOZ_ASSERT(aWindow->IsInnerWindow()); + MOZ_ALWAYS_TRUE(mConstructors.init()); + mozilla::HoldJSObjects(this); if (!sProcessingStack) { @@ -254,12 +234,6 @@ CustomElementRegistry::~CustomElementRegistry() mozilla::DropJSObjects(this); } -bool -CustomElementRegistry::Init() -{ - return mConstructors.init(); -} - CustomElementDefinition* CustomElementRegistry::LookupCustomElementDefinition(const nsAString& aLocalName, const nsAString* aIs) const |