diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-19 22:18:56 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:45 -0500 |
commit | c199dd22e6722a693ece15422ee3ec224f6d0a28 (patch) | |
tree | 2d680cb15ba2ae6287e95b6cb84ec5a8f485e2aa /dom/base | |
parent | e62385604d8003b223a35dd79ceefa483d15aab6 (diff) | |
download | UXP-c199dd22e6722a693ece15422ee3ec224f6d0a28.tar UXP-c199dd22e6722a693ece15422ee3ec224f6d0a28.tar.gz UXP-c199dd22e6722a693ece15422ee3ec224f6d0a28.tar.lz UXP-c199dd22e6722a693ece15422ee3ec224f6d0a28.tar.xz UXP-c199dd22e6722a693ece15422ee3ec224f6d0a28.zip |
Bug 1406325 - Part 2: Set CustomElementData when cloning a node.
Tag UXP Issue #1344
Diffstat (limited to 'dom/base')
-rw-r--r-- | dom/base/nsNodeUtils.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dom/base/nsNodeUtils.cpp b/dom/base/nsNodeUtils.cpp index 862b5db14..3670b5438 100644 --- a/dom/base/nsNodeUtils.cpp +++ b/dom/base/nsNodeUtils.cpp @@ -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, |