Bug 1361548 - Removed unreachable isCollapsed if condition. r=mats
authorLorena Diaconescu <lorena9921@hotmail.com>
Wed, 06 Sep 2017 15:48:20 -0400
changeset 379849 0fd16b5ccce0
parent 379848 439bc21d3947
child 379850 df45169ad2ee
push id50814
push userryanvm@gmail.com
push dateFri, 08 Sep 2017 21:12:40 +0000
treeherderautoland@0fd16b5ccce0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1361548
milestone57.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 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;
 }