summaryrefslogtreecommitdiff
path: root/dom/html/nsHTMLContentSink.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-19 22:59:16 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:46 -0500
commitfb657f7a1e3ef326214e0c42a5a0dd6dc0109338 (patch)
tree5b928a47adc3834d4248e82898ae30e2fe0df43c /dom/html/nsHTMLContentSink.cpp
parent72d4c0b8df4a0080ee10ba302dd4fafeacd0f560 (diff)
downloaduxp-fb657f7a1e3ef326214e0c42a5a0dd6dc0109338.tar.gz
Bug 1406325 - Part 4: Use mType for LookupCustomElementDefinition and also removing parts of v0.
Tag UXP Issue #1344
Diffstat (limited to 'dom/html/nsHTMLContentSink.cpp')
-rw-r--r--dom/html/nsHTMLContentSink.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/dom/html/nsHTMLContentSink.cpp b/dom/html/nsHTMLContentSink.cpp
index 518a3675e5..7d60fffb55 100644
--- a/dom/html/nsHTMLContentSink.cpp
+++ b/dom/html/nsHTMLContentSink.cpp
@@ -267,6 +267,8 @@ NS_NewHTMLElement(Element** aResult, already_AddRefed<mozilla::dom::NodeInfo>&&
return NS_ERROR_OUT_OF_MEMORY;
nsIAtom *name = nodeInfo->NameAtom();
+ RefPtr<nsIAtom> tagAtom = nodeInfo->NameAtom();
+ RefPtr<nsIAtom> typeAtom = aIs ? NS_Atomize(*aIs) : tagAtom;
NS_ASSERTION(nodeInfo->NamespaceEquals(kNameSpaceID_XHTML),
"Trying to HTML elements that don't have the XHTML namespace");
@@ -283,7 +285,7 @@ NS_NewHTMLElement(Element** aResult, already_AddRefed<mozilla::dom::NodeInfo>&&
nsContentUtils::LookupCustomElementDefinition(nodeInfo->GetDocument(),
nodeInfo->LocalName(),
nodeInfo->NamespaceID(),
- aIs);
+ typeAtom);
}
// It might be a problem that parser synchronously calls constructor, so filed
@@ -326,8 +328,6 @@ NS_NewHTMLElement(Element** aResult, already_AddRefed<mozilla::dom::NodeInfo>&&
// SetupCustomElement() should be called with an element that don't have
// CustomElementData setup, if not we will hit the assertion in
// SetCustomElementData().
- nsCOMPtr<nsIAtom> tagAtom = nodeInfo->NameAtom();
- nsCOMPtr<nsIAtom> typeAtom = aIs ? NS_Atomize(*aIs) : tagAtom;
// Built-in element
*aResult = CreateHTMLElement(tag, nodeInfo.forget(), aFromParser).take();
(*aResult)->SetCustomElementData(new CustomElementData(typeAtom));
@@ -377,7 +377,7 @@ NS_NewHTMLElement(Element** aResult, already_AddRefed<mozilla::dom::NodeInfo>&&
if (CustomElementRegistry::IsCustomElementEnabled() &&
(isCustomElementName || aIs)) {
- nsContentUtils::SetupCustomElement(*aResult, aIs);
+ (*aResult)->SetCustomElementData(new CustomElementData(typeAtom));
}
return NS_OK;