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
--- 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;