mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 10:45:42 +00:00
Bug 308120: Deal better with anonymous (direct) children being moved in the DOM.
r=bz sr=bryner
This commit is contained in:
parent
31dfa6179b
commit
690581075f
@ -3401,11 +3401,11 @@ nsGenericElement::doInsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
|
||||
|
||||
doc_fragment->DropChildReferences();
|
||||
} else {
|
||||
nsCOMPtr<nsIDOMNode> oldParent;
|
||||
res = aNewChild->GetParentNode(getter_AddRefs(oldParent));
|
||||
|
||||
if (NS_FAILED(res)) {
|
||||
return res;
|
||||
nsIContent* bindingParent = newContent->GetBindingParent();
|
||||
if (bindingParent == newContent ||
|
||||
(bindingParent && bindingParent == newContent->GetParent())) {
|
||||
// We can't deal with this so just bail
|
||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3414,6 +3414,9 @@ nsGenericElement::doInsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
|
||||
* aNewChild is a document. This code also handles the case where the
|
||||
* new child is alleady a child of this node-- jst@citec.fi
|
||||
*/
|
||||
nsCOMPtr<nsIDOMNode> oldParent;
|
||||
res = aNewChild->GetParentNode(getter_AddRefs(oldParent));
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
if (oldParent) {
|
||||
nsCOMPtr<nsIDOMNode> tmpNode;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user