Bug 1279708 - update the geometry of all ranges upon the next dimmed mask repaint in the case of a 'findAgain' update, because the page may have scrolled. r=jaws

MozReview-Commit-ID: 24yJELk5amc

--HG--
extra : rebase_source : 7756f4c33dc4bbea9537e93e8e8791697abff2ff
This commit is contained in:
Mike de Boer 2016-09-15 16:49:19 +02:00
parent 7b430eae7d
commit b8a3b8da7a

View File

@ -426,6 +426,9 @@ FinderHighlighter.prototype = {
dict.brightText = this._isColorBright(fontStyle.color);
}
if (data.findAgain)
dict.updateAllRanges = true;
if (!dict.visible)
this.show(window);
else
@ -1030,10 +1033,10 @@ FinderHighlighter.prototype = {
const rectStyle = this._getStyleString(kModalStyles.maskRect,
dict.brightText ? kModalStyles.maskRectBrightText : []);
for (let [range, rects] of dict.modalHighlightRectsMap) {
if (this._checkOverlap(dict.currentFoundRange, range))
continue;
if (dict.updateAllRanges)
rects = this._updateRangeRects(range);
if (this._checkOverlap(dict.currentFoundRange, range))
continue;
for (let rect of rects) {
maskContent.push(`<div xmlns="${kNSHTML}" style="${rectStyle}; top: ${rect.y}px;
left: ${rect.x}px; height: ${rect.height}px; width: ${rect.width}px;"></div>`);