Bug 1302470 Part 3: Call the new isRangeVisible function to determine whether or not to draw a highlight rect. r?mikedeboer draft
authorMike de Boer <mdeboer@mozilla.com>
Thu, 10 Nov 2016 09:03:58 -0800
changeset 439370 e4b9ff28628d6f5a141dd3f8d75f3e794f13b993
parent 439369 c00eca2b7c49a6dc0ffdbcf5f21829bb05424971
child 439371 f141f111b1369e75a667a6d58cd9ec4a61579842
push id35986
push userbwerth@mozilla.com
push dateTue, 15 Nov 2016 22:45:37 +0000
reviewersmikedeboer
bugs1302470
milestone53.0a1
Bug 1302470 Part 3: Call the new isRangeVisible function to determine whether or not to draw a highlight rect. r?mikedeboer MozReview-Commit-ID: ExO6zdjHGVO
toolkit/modules/FinderHighlighter.jsm
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -1134,16 +1134,19 @@ FinderHighlighter.prototype = {
     this._updateRangeOutline(dict);
 
     let allRects = [];
     if (paintContent || dict.modalHighlightAllMask) {
       this._updateDynamicRangesRects(dict);
 
       let DOMRect = window.DOMRect;
       for (let [range, rects] of dict.modalHighlightRectsMap) {
+        if (!this.finder._fastFind.isRangeVisible(range, false))
+          continue;
+
         if (dict.updateAllRanges)
           rects = 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;