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
This commit is contained in:
bzbarsky%mit.edu
2005-06-09 01:06:46 +00:00
parent 1ae3ea22ad
commit f980350d45

View File

@@ -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<nsINodeInfo> 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);