Fixing bug 348062. Making nsContentList hold strong references to the nodes in the list. r+sr=bzbarsky@mit.edu

This commit is contained in:
jst@mozilla.jstenback.com
2006-08-25 17:45:25 +00:00
parent ae0164c276
commit 2eb2c291a7
6 changed files with 49 additions and 77 deletions

View File

@@ -2422,7 +2422,8 @@ nsGenericElement::doInsertChildAt(nsIContent* aKid, PRUint32 aIndex,
NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_NODEINSERTED);
mutation.mRelatedNode = do_QueryInterface(container);
nsEventDispatcher::Dispatch(aKid, nsnull, &mutation);
nsEventDispatcher::Dispatch(aKid, nsnull, &mutation, nsnull, nsnull,
nsnull, PR_FALSE, PR_FALSE);
}
}
@@ -2471,7 +2472,8 @@ nsGenericElement::doRemoveChildAt(PRUint32 aIndex, PRBool aNotify,
NS_EVENT_BITS_MUTATION_NODEREMOVED)) {
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_NODEREMOVED);
mutation.mRelatedNode = do_QueryInterface(container);
nsEventDispatcher::Dispatch(aKid, nsnull, &mutation);
nsEventDispatcher::Dispatch(aKid, nsnull, &mutation, nsnull, nsnull,
nsnull, PR_FALSE, PR_FALSE);
}
// Someone may have removed the kid or any of its siblings while that event
@@ -3411,7 +3413,8 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
mutation.mPrevAttrValue = do_GetAtom(aOldValue);
}
mutation.mAttrChange = modType;
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
nsEventDispatcher::Dispatch(this, nsnull, &mutation, nsnull, nsnull,
nsnull, PR_FALSE, PR_FALSE);
}
if (aNotify) {
@@ -3611,7 +3614,8 @@ nsGenericElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
mutation.mPrevAttrValue = do_GetAtom(value);
mutation.mAttrChange = nsIDOMMutationEvent::REMOVAL;
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
nsEventDispatcher::Dispatch(this, nsnull, &mutation, nsnull, nsnull, nsnull,
PR_FALSE, PR_FALSE);
}
// Clear binding to nsIDOMNamedNodeMap