Bug 714587 - If the new boundary point is null, as it is for the call from Reset(), then it's expected that the new common ancestor is also null. r=smaug
authorMats Palmgren <matspal@gmail.com>
Sat, 28 Jan 2012 16:55:23 +0100
changeset 86891 0529bd4e33bd98387942bdf433c3c8657d53d332
parent 86890 d78b890eae96f68e8c0c29003c60448284b57d94
child 86892 bcaff471b3850653e73a4bb9427475f65d99afac
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs714587
milestone12.0a1
Bug 714587 - If the new boundary point is null, as it is for the call from Reset(), then it's expected that the new common ancestor is also null. r=smaug
content/base/src/nsRange.cpp
--- a/content/base/src/nsRange.cpp
+++ b/content/base/src/nsRange.cpp
@@ -745,17 +745,18 @@ nsRange::DoSetRange(nsINode* aStartN, PR
     nsINode* newCommonAncestor = GetCommonAncestor();
     if (newCommonAncestor != oldCommonAncestor) {
       if (oldCommonAncestor) {
         UnregisterCommonAncestor(oldCommonAncestor);
       }
       if (newCommonAncestor) {
         RegisterCommonAncestor(newCommonAncestor);
       } else {
-        NS_ASSERTION(mIsDetached, "unexpected disconnected nodes");
+        NS_ASSERTION(mIsDetached || !mIsPositioned,
+                     "unexpected disconnected nodes");
         mInSelection = false;
       }
     }
   }
 
   // This needs to be the last thing this function does.  See comment
   // in ParentChainChanged.
   mRoot = aRoot;