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
--- 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