Fixing bug 233137. Work around the problem with reparenting XPConnect wrappers for XUL elements by just not doing it, like we used not to before the fix for bug 197427 was checked in. r=bzbarsky@mit.edu, sr=dbaron@dbaron.org

This commit is contained in:
jst%mozilla.jstenback.com 2004-02-25 23:57:28 +00:00
Родитель 1f5de47936
Коммит 6c6eb77cec
1 изменённых файлов: 21 добавлений и 19 удалений

Просмотреть файл

@ -1732,21 +1732,19 @@ nsGenericElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
}
}
if (aDocument) {
// check the document on the nodeinfo to see whether we need a
// new nodeinfo
if (aDocument != mNodeInfo->GetDocument()) {
// get a new nodeinfo
nsINodeInfoManager* nodeInfoManager = aDocument->GetNodeInfoManager();
if (nodeInfoManager) {
nsCOMPtr<nsINodeInfo> newNodeInfo;
nodeInfoManager->GetNodeInfo(mNodeInfo->NameAtom(),
mNodeInfo->GetPrefixAtom(),
mNodeInfo->NamespaceID(),
getter_AddRefs(newNodeInfo));
if (newNodeInfo) {
mNodeInfo = newNodeInfo;
}
// check the document on the nodeinfo to see whether we need a
// new nodeinfo
if (aDocument && aDocument != mNodeInfo->GetDocument()) {
// get a new nodeinfo
nsINodeInfoManager* nodeInfoManager = aDocument->GetNodeInfoManager();
if (nodeInfoManager) {
nsCOMPtr<nsINodeInfo> newNodeInfo;
nodeInfoManager->GetNodeInfo(mNodeInfo->NameAtom(),
mNodeInfo->GetPrefixAtom(),
mNodeInfo->NamespaceID(),
getter_AddRefs(newNodeInfo));
if (newNodeInfo) {
mNodeInfo.swap(newNodeInfo);
}
}
}
@ -2855,8 +2853,10 @@ nsGenericElement::doInsertBefore(nsIContent *aElement, nsIDOMNode *aNewChild,
}
}
nsContentUtils::ReparentContentWrapper(newContent, aElement,
aElement->GetDocument(), old_doc);
if (!newContent->IsContentOfType(eXUL)) {
nsContentUtils::ReparentContentWrapper(newContent, aElement,
aElement->GetDocument(), old_doc);
}
res = aElement->InsertChildAt(newContent, refPos, PR_TRUE, PR_TRUE);
@ -3036,8 +3036,10 @@ nsGenericElement::doReplaceChild(nsIContent* aElement, nsIDOMNode* aNewChild,
}
}
nsContentUtils::ReparentContentWrapper(newContent, aElement,
aElement->GetDocument(), old_doc);
if (!newContent->IsContentOfType(eXUL)) {
nsContentUtils::ReparentContentWrapper(newContent, aElement,
aElement->GetDocument(), old_doc);
}
if (aNewChild == aOldChild) {
// We're replacing a child with itself. In this case the child