From 982f8ab64c6f23d962e1ca53f9e235bd23f63b4c Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Thu, 4 Apr 2002 14:50:39 +0000 Subject: [PATCH] the gfx scrollframe sets curpos long before maxpos when going back on a page. this means we cannot keep the check that verifies curpos <= maxpos. r=ccarlen/sr=brendan/a=asa. bug# 134782 git-svn-id: svn://10.0.0.236/trunk@118116 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/mac/nsNativeScrollbar.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mozilla/widget/src/mac/nsNativeScrollbar.cpp b/mozilla/widget/src/mac/nsNativeScrollbar.cpp index dd546abe1cc..f71d951cd7f 100644 --- a/mozilla/widget/src/mac/nsNativeScrollbar.cpp +++ b/mozilla/widget/src/mac/nsNativeScrollbar.cpp @@ -380,8 +380,16 @@ nsNativeScrollbar::SetPosition(PRUint32 aPos) aPos = 0; PRInt32 oldValue = mValue; - mValue = ((PRInt32)aPos) > mMaxValue ? mMaxValue : ((int)aPos); - + + // while we _should_ be ensuring that we don't set our value higher + // than our max value, the gfx scrollview code plays fast and loose + // with the rules while going back/forward and adjusts the value to the + // previous value long before it sets the max. As a result, we would + // lose the given value (since max would most likely be 0). The only + // way around that is to relax our restrictions a little bit. (bug 135191) + // mValue = ((PRInt32)aPos) > mMaxValue ? mMaxValue : ((int)aPos); + mValue = aPos; + // redraw the scrollbar. We can do the update later since we'll // always redraw our parent when we're in a tight loop. if ( mValue != oldValue )