Bug 913756 - Text Selection Handles displayed from position in previously navigated screen, r=margaret
authorMark Capella <markcapella@twcny.rr.com>
Mon, 09 Sep 2013 17:48:19 -0400
changeset 159226 2dc3f0600dce510dd29ecc5e98bc84502a08834b
parent 159123 a468b2e34b043362715ea032ca204d35bd99fc9f
child 159227 20b0a55f4f17c013b6eef5f5eeeb4abef28d2688
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs913756
milestone26.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 913756 - Text Selection Handles displayed from position in previously navigated screen, r=margaret
mobile/android/chrome/content/SelectionHandler.js
--- a/mobile/android/chrome/content/SelectionHandler.js
+++ b/mobile/android/chrome/content/SelectionHandler.js
@@ -505,17 +505,19 @@ var SelectionHandler = {
   },
 
   _clearSelection: function sh_clearSelection() {
     let selection = this._getSelection();
     if (selection) {
       // Remove our listener before we clear the selection
       selection.QueryInterface(Ci.nsISelectionPrivate).removeSelectionListener(this);
       // Clear selection without clearing the anchorNode or focusNode
-      selection.collapseToStart();
+      if (selection.rangeCount != 0) {
+        selection.collapseToStart();
+      }
     }
   },
 
   _deactivate: function sh_deactivate() {
     this._activeType = this.TYPE_NONE;
 
     sendMessageToJava({ type: "TextSelection:HideHandles" });