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 draft
authorMike de Boer <mdeboer@mozilla.com>
Thu, 15 Sep 2016 13:03:02 +0200
changeset 413941 e8686f79155e9880b6f3bd90c07bcd38aa4a7a65
parent 413935 ae573cac525d84ec38fc4320f8b9ea4e28fd88a3
child 414074 a99c873438a340bfff536ed6dc760c65400b81d3
push id29563
push usermdeboer@mozilla.com
push dateThu, 15 Sep 2016 11:03:31 +0000
reviewersGijs
bugs1302011
milestone51.0a1
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
toolkit/modules/FinderHighlighter.jsm
--- 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);
       }