Fix state restoration for RTL cases. b=331607 Patch from Hideo Saito <saito@densan.co.jp>. r+sr=dbaron

This commit is contained in:
dbaron%dbaron.org 2006-04-07 19:51:46 +00:00
parent c945ce38f4
commit 9e499dc761

View File

@ -781,6 +781,7 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
return rv;
PlaceScrollArea(state);
mInner.ScrollToRestoredPosition();
if (!mInner.mSupppressScrollbarUpdate) {
PRBool didHaveHScrollbar = mInner.mHasHorizontalScrollbar;
@ -805,7 +806,6 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
oldScrollAreaBounds, state.mScrollPortRect);
}
}
ScrollToRestoredPosition();
aDesiredSize.width = state.mInsideBorderSize.width +
state.mComputedBorder.LeftRight();
@ -1539,7 +1539,7 @@ nsGfxScrollFrameInner::ScrollToRestoredPosition()
// if our position is greater than the scroll position, scroll.
// remember that we could be incrementally loading so we may enter
// and scroll many times.
if (y > cy || x > cx) {
if (y != cy || x != cx) {
scrollingView->ScrollTo(x, y, 0);
// scrollpostion goes from twips to pixels. this fixes any roundoff
// problems.