mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
Bug 1341693 - Don't need to check GetDocShell() when creating CustomElementRegistry;
Tag UXP Issue #1344
This commit is contained in:
parent
a91f703945
commit
62678b52de
5 changed files with 23 additions and 35 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue