diff options
Diffstat (limited to 'dom/html/nsHTMLContentSink.cpp')
-rw-r--r-- | dom/html/nsHTMLContentSink.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dom/html/nsHTMLContentSink.cpp b/dom/html/nsHTMLContentSink.cpp index 518a3675e..7d60fffb5 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; |