Bug 1305059 - Adhere to the 'drawOutline' option as passed in by the Finder to decide whether an outline should be visible. r=jaws
authorMike de Boer <mdeboer@mozilla.com>
Thu, 12 Oct 2017 16:57:26 +0200
changeset 385927 66b011b6b2af7b3bbefddc870352df92bf88cf38
parent 385926 5ede138b6e27cfd84d87e65e039623a5dc683121
child 385970 1b6a3e8b08935eddd2291d8c1fb83a70dd5e7e47
push id53217
push usermdeboer@mozilla.com
push dateThu, 12 Oct 2017 22:36:37 +0000
treeherderautoland@66b011b6b2af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1305059
milestone58.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 1305059 - Adhere to the 'drawOutline' option as passed in by the Finder to decide whether an outline should be visible. r=jaws MozReview-Commit-ID: 2vVAp5HoKTO
toolkit/modules/FinderHighlighter.jsm
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -194,22 +194,23 @@ FinderHighlighter.prototype = {
       } catch (ex) {}
     }
   },
 
   /**
    * Toggle highlighting all occurrences of a word in a page. This method will
    * be called recursively for each (i)frame inside a page.
    *
-   * @param {Booolean} highlight Whether highlighting should be turned on
-   * @param {String}   word      Needle to search for and highlight when found
-   * @param {Boolean}  linksOnly Only consider nodes that are links for the search
+   * @param {Booolean} highlight   Whether highlighting should be turned on
+   * @param {String}   word        Needle to search for and highlight when found
+   * @param {Boolean}  linksOnly   Only consider nodes that are links for the search
+   * @param {Boolean}  drawOutline Whether found links should be outlined.
    * @yield {Promise}  that resolves once the operation has finished
    */
-  async highlight(highlight, word, linksOnly) {
+  async highlight(highlight, word, linksOnly, drawOutline) {
     let window = this.finder._getWindow();
     let dict = this.getForWindow(window);
     let controller = this.finder._getSelectionController(window);
     let doc = window.document;
     this._found = false;
 
     if (!controller || !doc || !doc.documentElement) {
       // Without the selection controller,
@@ -232,17 +233,17 @@ FinderHighlighter.prototype = {
           (this._modal && this.iterator._areParamsEqual(params, dict.lastIteratorParams))) {
         return;
       }
 
       if (!this._modal)
         dict.visible = true;
       await this.iterator.start(params);
       if (this._found)
-        this.finder._outlineLink(true);
+        this.finder._outlineLink(drawOutline);
     } else {
       this.hide(window);
 
       // Removing the highlighting always succeeds, so return true.
       this._found = true;
     }
 
     this.notifyFinished({ highlight, found: this._found });
@@ -420,17 +421,17 @@ FinderHighlighter.prototype = {
         dict.previousFoundRange = dict.currentFoundRange;
         dict.currentFoundRange = foundRange;
         let params = this.iterator.params;
         if (dict.visible && this.iterator._areParamsEqual(params, dict.lastIteratorParams))
           return;
         if (!dict.visible && !params)
           params = {word: data.searchString, linksOnly: data.linksOnly};
         if (params)
-          this.highlight(true, params.word, params.linksOnly);
+          this.highlight(true, params.word, params.linksOnly, params.drawOutline);
       }
       return;
     }
 
     dict.animateOutline = true;
     // Immediately finish running animations, if any.
     this._finishOutlineAnimations(dict);
 
@@ -440,17 +441,17 @@ FinderHighlighter.prototype = {
 
       if (!dict.visible)
         this.show(window);
       else
         this._maybeCreateModalHighlightNodes(window);
     }
 
     if (this._highlightAll)
-      this.highlight(true, data.searchString, data.linksOnly);
+      this.highlight(true, data.searchString, data.linksOnly, data.drawOutline);
   },
 
   /**
    * Invalidates the list by clearing the map of highlighted ranges that we
    * keep to build the mask for.
    */
   clear(window = null) {
     if (!window || !window.top)