diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-03 18:50:56 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:11 -0500 |
commit | 5cf46e2f87f4f6294d02d96c7905b069c9975eee (patch) | |
tree | 181ea678ca02fe40cd10ced900cf619cf8ced585 /dom/base/CustomElementRegistry.cpp | |
parent | 3a97503b361b0b5ff1b5d8948a74497710f2a095 (diff) | |
download | UXP-5cf46e2f87f4f6294d02d96c7905b069c9975eee.tar UXP-5cf46e2f87f4f6294d02d96c7905b069c9975eee.tar.gz UXP-5cf46e2f87f4f6294d02d96c7905b069c9975eee.tar.lz UXP-5cf46e2f87f4f6294d02d96c7905b069c9975eee.tar.xz UXP-5cf46e2f87f4f6294d02d96c7905b069c9975eee.zip |
Bug 1341693 - Don't need to check GetDocShell() when creating CustomElementRegistry;
Tag UXP Issue #1344
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 |