Bug 1361548 - Removed unreachable isCollapsed if condition. r=mats draft
authorLorena Diaconescu <lorena9921@hotmail.com>
Wed, 06 Sep 2017 15:48:20 -0400
changeset 661502 55f08ef227bc96e31dbb83c597448274a7836a35
parent 660208 93dd2e456c0ecca00fb4d28744e88078a77deaf7
child 730597 54e219607a11ffa7ce1ad913075f02d70879c646
push id78788
push userbmo:lorena9921@hotmail.com
push dateFri, 08 Sep 2017 15:27:34 +0000
reviewersmats
bugs1361548
milestone57.0a1
Bug 1361548 - Removed unreachable isCollapsed if condition. r=mats MozReview-Commit-ID: EinCtNyaK6e
layout/generic/nsFrameSelection.cpp
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -2903,19 +2903,17 @@ nsFrameSelection::DeleteFromDocument()
     res = range->DeleteContents();
     if (NS_FAILED(res))
       return res;
   }
 
   // Collapse to the new location.
   // If we deleted one character, then we move back one element.
   // FIXME  We don't know how to do this past frame boundaries yet.
-  if (isCollapsed)
-    mDomSelections[index]->Collapse(mDomSelections[index]->GetAnchorNode(), mDomSelections[index]->AnchorOffset()-1);
-  else if (mDomSelections[index]->AnchorOffset() > 0)
+  if (mDomSelections[index]->AnchorOffset() > 0)
     mDomSelections[index]->Collapse(mDomSelections[index]->GetAnchorNode(), mDomSelections[index]->AnchorOffset());
 #ifdef DEBUG
   else
     printf("Don't know how to set selection back past frame boundary\n");
 #endif
 
   return NS_OK;
 }