Bug 1305420 - don't include the topmost windows' scroll-position for iframes, or else it will be counted twice. r?jaws draft
authorMike de Boer <mdeboer@mozilla.com>
Tue, 27 Sep 2016 14:14:57 +0200
changeset 417975 3fe6ffe40a2f2270aeadbafa985f50c6f99f0065
parent 417974 ffdd67bbdc083a20a440300fbfbd0402ff1cb169
child 532217 274f17e01fd373643757a47a4fcc434035b524c6
push id30543
push usermdeboer@mozilla.com
push dateTue, 27 Sep 2016 12:15:26 +0000
reviewersjaws
bugs1305420
milestone52.0a1
Bug 1305420 - don't include the topmost windows' scroll-position for iframes, or else it will be counted twice. r?jaws MozReview-Commit-ID: He9Jxtm5nPt
toolkit/modules/FinderHighlighter.jsm
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -564,17 +564,17 @@ FinderHighlighter.prototype = {
    *                                        Optional, defaults to `true`
    * @return {Rect}
    */
   _getRootBounds(window, includeScroll = true) {
     let dwu = this._getDWU(window.top);
     let cssPageRect = Rect.fromRect(dwu.getRootBounds());
     let scrollX = {};
     let scrollY = {};
-    if (includeScroll) {
+    if (includeScroll && window == window.top) {
       dwu.getScrollXY(false, scrollX, scrollY);
       cssPageRect.translate(scrollX.value, scrollY.value);
     }
 
     // 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