Fix check for DOMNodeInserted/DOMNodeRemoved event handlers. Bug 367164,

r+sr=sicking
This commit is contained in:
bzbarsky@mit.edu
2007-01-17 18:47:18 +00:00
parent 0f0aa84430
commit ca728ace4a
3 changed files with 51 additions and 2 deletions

View File

@@ -2328,7 +2328,7 @@ nsGenericElement::doInsertChildAt(nsIContent* aKid, PRUint32 aIndex,
nsNodeUtils::ContentInserted(container, aKid, aIndex);
}
if (nsContentUtils::HasMutationListeners(container,
if (nsContentUtils::HasMutationListeners(aKid,
NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_NODEINSERTED);
mutation.mRelatedNode = do_QueryInterface(container);
@@ -2377,7 +2377,7 @@ nsGenericElement::doRemoveChildAt(PRUint32 aIndex, PRBool aNotify,
nsMutationGuard guard;
if (aNotify &&
nsContentUtils::HasMutationListeners(container,
nsContentUtils::HasMutationListeners(aKid,
NS_EVENT_BITS_MUTATION_NODEREMOVED)) {
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_NODEREMOVED);
mutation.mRelatedNode = do_QueryInterface(container);