Bug 1302470 Part 6: Connect up FinderHighlighter.jsm with the new isRangeVisible function. r=mikedeboer
☠☠ backed out by 40978edd88b7 ☠ ☠
authorMike de Boer <mdeboer@mozilla.com>
Mon, 23 Jan 2017 17:39:07 +0100
changeset 402427 eb2930fc7c597cc894eec94344af56804a1d157f
parent 402426 4fc16536ce41582bf99fedd22eb1b3bf3242d3a2
child 402428 85548886215546769bdaa533223424151080a458
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1302470
milestone55.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 1302470 Part 6: Connect up FinderHighlighter.jsm with the new isRangeVisible function. r=mikedeboer MozReview-Commit-ID: ABfAoZ4CBjP
toolkit/modules/FinderHighlighter.jsm
toolkit/modules/FinderIterator.jsm
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -1125,16 +1125,19 @@ FinderHighlighter.prototype = {
     if (paintContent || dict.modalHighlightAllMask) {
       // No need to update dynamic ranges separately when we already about to
       // update all of them anyway.
       if (!dict.updateAllRanges)
         this._updateDynamicRangesRects(dict);
 
       let DOMRect = window.DOMRect;
       for (let [range, rectsAndTexts] of dict.modalHighlightRectsMap) {
+        if (!this.finder._fastFind.isRangeVisible(range, false))
+          continue;
+
         if (dict.updateAllRanges)
           rectsAndTexts = this._updateRangeRects(range);
 
         // If a geometry change was detected, we bail out right away here, because
         // the current set of ranges has been invalidated.
         if (dict.detectedGeometryChange)
           return;
 
--- a/toolkit/modules/FinderIterator.jsm
+++ b/toolkit/modules/FinderIterator.jsm
@@ -585,17 +585,17 @@ this.FinderIterator = {
       // Don't count matches in hidden frames.
       let frameEl = frame && frame.frameElement;
       if (!frameEl)
         continue;
       // Construct a range around the frame element to check its visiblity.
       let range = window.document.createRange();
       range.setStart(frameEl, 0);
       range.setEnd(frameEl, 0);
-      if (!finder._fastFind.isRangeVisible(range, this._getDocShell(range), true))
+      if (!finder._fastFind.isRangeVisible(range, false))
         continue;
       // All conditions pass, so push the current frame and its children on the
       // stack.
       frames.push(frame, ...this._collectFrames(frame, finder));
     }
 
     return frames;
   },