Bug 1334213 - listen to scroll events at the capturing phase to make sure to catch them when event propagation is stopped by a script in the current document. Also make sure to always update the yellow range outline position. r=jaws

MozReview-Commit-ID: 8C5uccBFGJ7

--HG--
extra : rebase_source : 7437e7479c597dc8b47b4f12c31ebe3e996c1e91
This commit is contained in:
Mike de Boer 2017-02-02 14:59:53 +01:00
Родитель 6ed3a378bc
Коммит 4811200bb1
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -885,7 +885,7 @@ FinderHighlighter.prototype = {
// Text color in the outline is determined by kModalStyles.
delete fontStyle.color;
let rectsAndTexts = this._getRangeRectsAndTexts(range);
let rectsAndTexts = this._updateRangeRects(range, true, dict);
let outlineAnonNode = dict.modalHighlightOutline;
let rectCount = rectsAndTexts.rectList.length;
let previousRectCount = dict.previousRangeRectsAndTexts.rectList.length;
@ -1279,7 +1279,7 @@ FinderHighlighter.prototype = {
let target = this.iterator._getDocShell(window).chromeEventHandler;
target.addEventListener("MozAfterPaint", dict.highlightListeners[0]);
target.addEventListener("resize", dict.highlightListeners[1]);
target.addEventListener("scroll", dict.highlightListeners[2]);
target.addEventListener("scroll", dict.highlightListeners[2], { capture: true, passive: true });
target.addEventListener("click", dict.highlightListeners[3]);
target.addEventListener("selectstart", dict.highlightListeners[4]);
},
@ -1298,7 +1298,7 @@ FinderHighlighter.prototype = {
let target = this.iterator._getDocShell(window).chromeEventHandler;
target.removeEventListener("MozAfterPaint", dict.highlightListeners[0]);
target.removeEventListener("resize", dict.highlightListeners[1]);
target.removeEventListener("scroll", dict.highlightListeners[2]);
target.removeEventListener("scroll", dict.highlightListeners[2], { capture: true, passive: true });
target.removeEventListener("click", dict.highlightListeners[3]);
target.removeEventListener("selectstart", dict.highlightListeners[4]);