Bug 963925 - Do not store searchString upon Highlight. r=Unfocused, a=lsblakk
authorMike de Boer <mdeboer@mozilla.com>
Fri, 28 Feb 2014 15:57:20 +0100
changeset 176403 a910892387e1defe4e2385e89814b6c23ffc71b1
parent 176402 7bf309f95730dd092f84a61235eba45782d1d4d0
child 176404 860e76ec9fe57cc83757089e5946a24fc6456bc3
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused, lsblakk
bugs963925
milestone28.0
Bug 963925 - Do not store searchString upon Highlight. r=Unfocused, a=lsblakk
toolkit/modules/Finder.jsm
--- a/toolkit/modules/Finder.jsm
+++ b/toolkit/modules/Finder.jsm
@@ -30,18 +30,19 @@ Finder.prototype = {
     if (this._listeners.indexOf(aListener) === -1)
       this._listeners.push(aListener);
   },
 
   removeResultListener: function (aListener) {
     this._listeners = this._listeners.filter(l => l != aListener);
   },
 
-  _notify: function (aSearchString, aResult, aFindBackwards, aDrawOutline) {
-    this._searchString = aSearchString;
+  _notify: function (aSearchString, aResult, aFindBackwards, aDrawOutline, aStoreResult = true) {
+    if (aStoreResult)
+      this._searchString = aSearchString;
     this._outlineLink(aDrawOutline);
 
     let foundLink = this._fastFind.foundLink;
     let linkURL = null;
     if (foundLink) {
       let docCharset = null;
       let ownerDoc = foundLink.ownerDocument;
       if (ownerDoc)
@@ -51,17 +52,17 @@ Finder.prototype = {
         this._textToSubURIService = Cc["@mozilla.org/intl/texttosuburi;1"]
                                       .getService(Ci.nsITextToSubURI);
       }
 
       linkURL = this._textToSubURIService.unEscapeURIForUI(docCharset, foundLink.href);
     }
 
     for (let l of this._listeners) {
-      l.onFindResult(aResult, aFindBackwards, linkURL);
+      l.onFindResult(aResult, aFindBackwards, linkURL, aStoreResult);
     }
   },
 
   get searchString() {
     return this._searchString;
   },
 
   set caseSensitive(aSensitive) {
@@ -96,17 +97,17 @@ Finder.prototype = {
     this._notify(searchString, result, aFindBackwards, aDrawOutline);
   },
 
   highlight: function (aHighlight, aWord) {
     let found = this._highlight(aHighlight, aWord, null);
     if (aHighlight) {
       let result = found ? Ci.nsITypeAheadFind.FIND_FOUND
                          : Ci.nsITypeAheadFind.FIND_NOTFOUND;
-      this._notify(aWord, result, false, false);
+      this._notify(aWord, result, false, false, false);
     }
   },
 
   enableSelection: function() {
     this._fastFind.setSelectionModeAndRepaint(Ci.nsISelectionController.SELECTION_ON);
     this._restoreOriginalOutline();
   },