Bug 1030060 - Regression in Find-In-Page logic due to SelectionHandler change in bug 1011059, r=margaret, r=jchen
authorMark Capella <markcapella@twcny.rr.com>
Wed, 16 Jul 2014 03:23:05 -0400
changeset 216255 451ee12473f76f23951d0a3446423c1850167ea6
parent 216254 4acab4ceb782eddced0eba402084052c7ac90f51
child 216256 0139b24156be0b0f65b0e4e922201871ed84b143
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, jchen
bugs1030060, 1011059
milestone33.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 1030060 - Regression in Find-In-Page logic due to SelectionHandler change in bug 1011059, r=margaret, r=jchen
mobile/android/chrome/content/SelectionHandler.js
--- a/mobile/android/chrome/content/SelectionHandler.js
+++ b/mobile/android/chrome/content/SelectionHandler.js
@@ -382,16 +382,18 @@ var SelectionHandler = {
     return true;
   },
 
   /*
    * Called to perform a selection operation, given a target element, selection method, starting point etc.
    */
   _performSelection: function sh_performSelection(aOptions) {
     if (aOptions.mode == this.SELECT_AT_POINT) {
+      // Clear any ranges selected outside SelectionHandler, by code such as Find-In-Page.
+      this._contentWindow.getSelection().removeAllRanges();
       return this._domWinUtils.selectAtPoint(aOptions.x, aOptions.y, Ci.nsIDOMWindowUtils.SELECT_WORDNOSPACE);
     }
 
     if (aOptions.mode != this.SELECT_ALL) {
       Cu.reportError("SelectionHandler.js: _performSelection() Invalid selection mode " + aOptions.mode);
       return false;
     }