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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user