From fb657f7a1e3ef326214e0c42a5a0dd6dc0109338 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sun, 19 Jan 2020 22:59:16 -0500 Subject: Bug 1406325 - Part 4: Use mType for LookupCustomElementDefinition and also removing parts of v0. Tag UXP Issue #1344 --- dom/html/nsHTMLContentSink.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dom/html') 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&& return NS_ERROR_OUT_OF_MEMORY; nsIAtom *name = nodeInfo->NameAtom(); + RefPtr tagAtom = nodeInfo->NameAtom(); + RefPtr 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&& 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&& // SetupCustomElement() should be called with an element that don't have // CustomElementData setup, if not we will hit the assertion in // SetCustomElementData(). - nsCOMPtr tagAtom = nodeInfo->NameAtom(); - nsCOMPtr 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&& if (CustomElementRegistry::IsCustomElementEnabled() && (isCustomElementName || aIs)) { - nsContentUtils::SetupCustomElement(*aResult, aIs); + (*aResult)->SetCustomElementData(new CustomElementData(typeAtom)); } return NS_OK; -- cgit v1.2.3