Bug 1302011 - if we keep referencing window, currWin will always remain the same, thus never reaching window.top to stop the while-loop. r?Gijs
MozReview-Commit-ID: EOeo16dxaVy
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -579,17 +579,17 @@ FinderHighlighter.prototype = {
}
// If we're in a frame, update the position of the rect (top/ left).
let currWin = window;
while (currWin != window.top) {
// Since the frame is an element inside a parent window, we'd like to
// learn its position relative to it.
let el = this._getDWU(currWin).containerElement;
- currWin = window.parent;
+ currWin = currWin.parent;
dwu = this._getDWU(currWin);
let parentRect = Rect.fromRect(dwu.getBoundsWithoutFlushing(el));
if (includeScroll) {
dwu.getScrollXY(false, scrollX, scrollY);
parentRect.translate(scrollX.value, scrollY.value);
}