From a07dc8e9867303591475421041a4886970f17964 Mon Sep 17 00:00:00 2001 From: Mike de Boer Date: Wed, 5 Oct 2016 15:30:33 +0200 Subject: [PATCH] Bug 1307328 - nested iframes combined with scrolling=no require special attention for rect positioning inside the findbar dimmed background. r=jaws MozReview-Commit-ID: JG99XMKsuIj --HG-- extra : rebase_source : adf22a6048ea53214bd3065143183bcd8f0670c2 --- toolkit/modules/FinderHighlighter.jsm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/toolkit/modules/FinderHighlighter.jsm b/toolkit/modules/FinderHighlighter.jsm index 94966998e183..1d2b46f54569 100644 --- a/toolkit/modules/FinderHighlighter.jsm +++ b/toolkit/modules/FinderHighlighter.jsm @@ -608,6 +608,14 @@ FinderHighlighter.prototype = { if (includeScroll) { dwu.getScrollXY(false, scrollX, scrollY); parentRect.translate(scrollX.value, scrollY.value); + // If the current window is an iframe with scrolling="no" and its parent + // is also an iframe the scroll offsets from the parents' documentElement + // (inverse scroll position) needs to be subtracted from the parent + // window rect. + if (el.getAttribute("scrolling") == "no" && currWin != window.top) { + let docEl = currWin.document.documentElement; + parentRect.translate(-docEl.scrollLeft, -docEl.scrollTop); + } } cssPageRect.translate(parentRect.left, parentRect.top);