diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-25 09:14:03 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:52 -0500 |
commit | 3c70b297c7be12b7d7e120de04a38f40b600928b (patch) | |
tree | fb5b7a509abe61a05bf6f3f88371271be4e5ccaa /dom/base/nsNodeUtils.cpp | |
parent | 0cea94242a555b7a8a2d956412da809a514814f7 (diff) | |
download | uxp-3c70b297c7be12b7d7e120de04a38f40b600928b.tar.gz |
Bug 1430951 - Avoid element name atomizing to improve performance of LookupCustomElementDefinition
Since we are dealing with the element (nodeInfo->LocalName() and NameAtom() are the same value), we could use nodeInfo->NameAtom() instead.
Tag UXP Issue #1344
Diffstat (limited to 'dom/base/nsNodeUtils.cpp')
-rw-r--r-- | dom/base/nsNodeUtils.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dom/base/nsNodeUtils.cpp b/dom/base/nsNodeUtils.cpp index f79da66523..384e56cde6 100644 --- a/dom/base/nsNodeUtils.cpp +++ b/dom/base/nsNodeUtils.cpp @@ -497,9 +497,11 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep, if (data || !extension.IsEmpty()) { RefPtr<nsIAtom> typeAtom = extension.IsEmpty() ? tagAtom : NS_Atomize(extension); cloneElem->SetCustomElementData(new CustomElementData(typeAtom)); + + MOZ_ASSERT(nodeInfo->NameAtom()->Equals(nodeInfo->LocalName())); CustomElementDefinition* definition = nsContentUtils::LookupCustomElementDefinition(nodeInfo->GetDocument(), - nodeInfo->LocalName(), + nodeInfo->NameAtom(), nodeInfo->NamespaceID(), typeAtom); if (definition) { |