mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Creating customized built-in elements without relevant definitions registered first shouldn't throw NotFoundError;
per spec change: https://github.com/w3c/webcomponents/issues/608 Tag UXP Issue #1344
This commit is contained in:
parent
cb89330bf3
commit
cca692c240
3 changed files with 0 additions and 94 deletions
|
|
@ -5395,14 +5395,6 @@ nsDocument::CreateElement(const nsAString& aTagName,
|
|||
}
|
||||
|
||||
const nsString* is = nullptr;
|
||||
if (aOptions.IsElementCreationOptions()) {
|
||||
// Throw NotFoundError if 'is' is not-null and definition is null
|
||||
is = CheckCustomElementName(aOptions.GetAsElementCreationOptions(),
|
||||
needsLowercase ? lcTagName : aTagName, mDefaultElementType, rv);
|
||||
if (rv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<Element> elem = CreateElem(
|
||||
needsLowercase ? lcTagName : aTagName, nullptr, mDefaultElementType, is);
|
||||
|
|
@ -5443,14 +5435,6 @@ nsDocument::CreateElementNS(const nsAString& aNamespaceURI,
|
|||
}
|
||||
|
||||
const nsString* is = nullptr;
|
||||
if (aOptions.IsElementCreationOptions()) {
|
||||
// Throw NotFoundError if 'is' is not-null and definition is null
|
||||
is = CheckCustomElementName(aOptions.GetAsElementCreationOptions(),
|
||||
aQualifiedName, nodeInfo->NamespaceID(), rv);
|
||||
if (rv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<Element> element;
|
||||
rv = NS_NewElement(getter_AddRefs(element), nodeInfo.forget(),
|
||||
|
|
@ -12757,30 +12741,6 @@ nsIDocument::UpdateStyleBackendType()
|
|||
#endif
|
||||
}
|
||||
|
||||
const nsString*
|
||||
nsDocument::CheckCustomElementName(const ElementCreationOptions& aOptions,
|
||||
const nsAString& aLocalName,
|
||||
uint32_t aNamespaceID,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
// only check aOptions if 'is' is passed and the webcomponents preference
|
||||
// is enabled
|
||||
if (!aOptions.mIs.WasPassed() ||
|
||||
!CustomElementRegistry::IsCustomElementEnabled()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const nsString* is = &aOptions.mIs.Value();
|
||||
|
||||
// Throw NotFoundError if 'is' is not-null and definition is null
|
||||
if (!nsContentUtils::LookupCustomElementDefinition(this, aLocalName,
|
||||
aNamespaceID, is)) {
|
||||
rv.Throw(NS_ERROR_DOM_NOT_FOUND_ERR);
|
||||
}
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
Selection*
|
||||
nsIDocument::GetSelection(ErrorResult& aRv)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue