From c29e28bbd056ff79b917e0085872ada68919519c Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Fri, 23 Apr 2010 14:41:37 +1200 Subject: [PATCH] Bug 548792. Fix rect coordinate adjustment. r=mats --- layout/base/nsPresShell.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 006e0fd0223a..f77c78b6ff14 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -4101,7 +4101,9 @@ PresShell::ScrollFrameRectIntoView(nsIFrame* aFrame, ScrollToShowRect(sf, rect - sf->GetScrolledFrame()->GetPosition(), aVPercent, aHPercent, aFlags); nsPoint newPosition = sf->GetScrollPosition(); - rect += newPosition - oldPosition; + // If the scroll position increased, that means our content moved up, + // so our rect's offset should decrease + rect += oldPosition - newPosition; if (oldPosition != newPosition) { didScroll = PR_TRUE;