mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 06:18:38 +09:00
Bug 1406325 - Part 2: Set CustomElementData when cloning a node.
Tag UXP Issue #1344
This commit is contained in:
parent
cce9b3379a
commit
05b01709b8
2 changed files with 70 additions and 4 deletions
|
|
@ -486,12 +486,12 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
|||
CustomElementDefinition* definition = nullptr;
|
||||
RefPtr<nsIAtom> tagAtom = nodeInfo->NameAtom();
|
||||
if (nsContentUtils::IsCustomElementName(tagAtom)) {
|
||||
elem->SetCustomElementData(new CustomElementData(tagAtom));
|
||||
definition =
|
||||
nsContentUtils::LookupCustomElementDefinition(nodeInfo->GetDocument(),
|
||||
nodeInfo->LocalName(),
|
||||
nodeInfo->NamespaceID());
|
||||
if (definition) {
|
||||
elem->SetCustomElementData(new CustomElementData(tagAtom));
|
||||
nsContentUtils::EnqueueUpgradeReaction(elem, definition);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -500,14 +500,14 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
|||
nsAutoString extension;
|
||||
if (elem->GetAttr(kNameSpaceID_None, nsGkAtoms::is, extension) &&
|
||||
!extension.IsEmpty()) {
|
||||
RefPtr<nsAtom> typeAtom = NS_Atomize(extension);
|
||||
elem->SetCustomElementData(new CustomElementData(typeAtom));
|
||||
definition =
|
||||
nsContentUtils::LookupCustomElementDefinition(nodeInfo->GetDocument(),
|
||||
nodeInfo->LocalName(),
|
||||
nodeInfo->NamespaceID(),
|
||||
&extension);
|
||||
if (definition) {
|
||||
RefPtr<nsIAtom> typeAtom = NS_Atomize(extension);
|
||||
elem->SetCustomElementData(new CustomElementData(typeAtom));
|
||||
nsContentUtils::EnqueueUpgradeReaction(elem, definition);
|
||||
}
|
||||
}
|
||||
|
|
@ -549,7 +549,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
|||
// shadow-including inclusive descendants that is custom.
|
||||
Element* element = aNode->IsElement() ? aNode->AsElement() : nullptr;
|
||||
if (element) {
|
||||
RefPtr<CustomElementData> data = element->GetCustomElementData();
|
||||
CustomElementData* data = element->GetCustomElementData();
|
||||
if (data && data->mState == CustomElementData::State::eCustom) {
|
||||
LifecycleAdoptedCallbackArgs args = {
|
||||
oldDoc,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue