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
This commit is contained in:
Mike de Boer 2016-10-05 15:30:33 +02:00
Родитель 5befc348f6
Коммит a07dc8e986
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -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);