Bug 679459 - "ASSERTION: mEndOffset is beyond the end of this node" in nsRange::ContentInserted. r=smaug
authorMats Palmgren <matspal@gmail.com>
Thu, 08 Sep 2011 23:32:07 +0200
changeset 76785 077597e9accd846d364cb60881bef60e05f7b80d
parent 76784 aea08d37a22b31c294f6be561d2c8599b57b334b
child 76786 ed1946447c5ea2998c826f190d3694989ccf8344
push id21141
push usereakhgari@mozilla.com
push dateFri, 09 Sep 2011 14:06:30 +0000
treeherdermozilla-central@694520af9b18 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs679459
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 679459 - "ASSERTION: mEndOffset is beyond the end of this node" in nsRange::ContentInserted. r=smaug
content/base/src/nsGenericDOMDataNode.cpp
--- a/content/base/src/nsGenericDOMDataNode.cpp
+++ b/content/base/src/nsGenericDOMDataNode.cpp
@@ -743,17 +743,18 @@ nsGenericDOMDataNode::SplitData(PRUint32
   if (!newContent) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
   newContent->SetText(cutText, PR_TRUE); // XXX should be PR_FALSE?
 
   CharacterDataChangeInfo::Details details = {
     CharacterDataChangeInfo::Details::eSplit, newContent
   };
-  rv = SetTextInternal(cutStartOffset, cutLength, nsnull, 0, PR_TRUE, &details);
+  rv = SetTextInternal(cutStartOffset, cutLength, nsnull, 0, PR_TRUE,
+                       aCloneAfterOriginal ? &details : nsnull);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsINode> parent = GetNodeParent();
   if (parent) {
     PRInt32 insertionIndex = parent->IndexOf(this);
     if (aCloneAfterOriginal) {