Landing fix for bug 394418. Notify on text changes before firing mutation events. Patch by bzbarsky@mit.edu, r+sr=jonas@sicking.cc, a=jst@mozilla.org/dsicore@mozilla.com
git-svn-id: svn://10.0.0.236/trunk@235481 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -470,6 +470,14 @@ nsGenericDOMDataNode::SetTextInternal(PRUint32 aOffset, PRUint32 aCount,
|
||||
|
||||
// Notify observers
|
||||
if (aNotify) {
|
||||
CharacterDataChangeInfo info = {
|
||||
aOffset == textLength,
|
||||
aOffset,
|
||||
endOffset,
|
||||
aLength
|
||||
};
|
||||
nsNodeUtils::CharacterDataChanged(this, &info);
|
||||
|
||||
if (haveMutationListeners) {
|
||||
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_CHARACTERDATAMODIFIED);
|
||||
|
||||
@@ -483,14 +491,6 @@ nsGenericDOMDataNode::SetTextInternal(PRUint32 aOffset, PRUint32 aCount,
|
||||
mozAutoSubtreeModified subtree(GetOwnerDoc(), this);
|
||||
nsEventDispatcher::Dispatch(this, nsnull, &mutation);
|
||||
}
|
||||
|
||||
CharacterDataChangeInfo info = {
|
||||
aOffset == textLength,
|
||||
aOffset,
|
||||
endOffset,
|
||||
aLength
|
||||
};
|
||||
nsNodeUtils::CharacterDataChanged(this, &info);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
||||
Reference in New Issue
Block a user