Bug 548792. Fix rect coordinate adjustment. r=mats

This commit is contained in:
Robert O'Callahan 2010-04-23 14:41:37 +12:00
parent 53eab1994a
commit fc7df512e2

View File

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