summaryrefslogtreecommitdiff
path: root/dom/html
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-25 09:14:03 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:52 -0500
commit834191ea990495ff1a296bdf06b4964506646442 (patch)
treefb5b7a509abe61a05bf6f3f88371271be4e5ccaa /dom/html
parent35c0fa8705d016a015ed25abe17f47c1001e1d76 (diff)
downloadaura-central-834191ea990495ff1a296bdf06b4964506646442.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 mcp-graveyard/UXP%1344
Diffstat (limited to 'dom/html')
-rw-r--r--dom/html/nsHTMLContentSink.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/dom/html/nsHTMLContentSink.cpp b/dom/html/nsHTMLContentSink.cpp
index 920ded728..1fe5d2a86 100644
--- a/dom/html/nsHTMLContentSink.cpp
+++ b/dom/html/nsHTMLContentSink.cpp
@@ -287,9 +287,10 @@ NS_NewHTMLElement(Element** aResult, already_AddRefed<mozilla::dom::NodeInfo>&&
CustomElementDefinition* definition = aDefinition;
if (CustomElementRegistry::IsCustomElementEnabled() && isCustomElement &&
!definition) {
+ MOZ_ASSERT(nodeInfo->NameAtom()->Equals(nodeInfo->LocalName()));
definition =
nsContentUtils::LookupCustomElementDefinition(nodeInfo->GetDocument(),
- nodeInfo->LocalName(),
+ nodeInfo->NameAtom(),
nodeInfo->NamespaceID(),
typeAtom);
}