From f980350d4586e061a65bb96896af1a5592976c9c Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 9 Jun 2005 01:06:46 +0000 Subject: [PATCH] Create non-XUL nodes in a XUL document with the right ownerDocument. Bug 294536, r+sr=peterv, a=asa git-svn-id: svn://10.0.0.236/trunk@174334 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/xul/document/src/nsXULDocument.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index 1b8a8103e5f..63b674d9b4d 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -3536,10 +3536,16 @@ nsXULDocument::CreateElementFromPrototype(nsXULPrototypeElement* aPrototype, else { // If it's not a XUL element, it's gonna be heavyweight no matter // what. So we need to copy everything out of the prototype - // into the element. - rv = NS_NewElement(getter_AddRefs(result), - aPrototype->mNodeInfo->NamespaceID(), - aPrototype->mNodeInfo); + // into the element. Get a nodeinfo from our nodeinfo manager + // for this node. + nsCOMPtr newNodeInfo; + rv = mNodeInfoManager->GetNodeInfo(aPrototype->mNodeInfo->NameAtom(), + aPrototype->mNodeInfo->GetPrefixAtom(), + aPrototype->mNodeInfo->NamespaceID(), + getter_AddRefs(newNodeInfo)); + if (NS_FAILED(rv)) return rv; + rv = NS_NewElement(getter_AddRefs(result), newNodeInfo->NamespaceID(), + newNodeInfo); if (NS_FAILED(rv)) return rv; rv = AddAttributes(aPrototype, result);