Bug 423355: Make sure that we never remove removable blockers more than once. Also make sure to never fire mutation events when it's not safe to run script. r/sr=bz/roc a=beltzner

git-svn-id: svn://10.0.0.236/trunk@250233 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jonas%sicking.cc
2008-04-14 23:59:23 +00:00
parent bca2f2d42a
commit 0108790da0
14 changed files with 220 additions and 131 deletions

View File

@@ -498,19 +498,21 @@ nsGenericDOMDataNode::SetTextInternal(PRUint32 aOffset, PRUint32 aCount,
nsNodeUtils::CharacterDataChanged(this, &info);
if (haveMutationListeners) {
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_CHARACTERDATAMODIFIED);
mozAutoRemovableBlockerRemover blockerRemover;
mutation.mPrevAttrValue = oldValue;
if (aLength > 0) {
nsAutoString val;
mText.AppendTo(val);
mutation.mNewAttrValue = do_GetAtom(val);
if (nsContentUtils::IsSafeToRunScript()) {
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_CHARACTERDATAMODIFIED);
mutation.mPrevAttrValue = oldValue;
if (aLength > 0) {
nsAutoString val;
mText.AppendTo(val);
mutation.mNewAttrValue = do_GetAtom(val);
}
mozAutoSubtreeModified subtree(GetOwnerDoc(), this);
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
}
mozAutoDocUpdateContentUnnest updateUnnest(document);
mozAutoSubtreeModified subtree(GetOwnerDoc(), this);
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
}
}