Restore code to refresh scrolledContentSize between horizontal and vertical scrollbar manipulation. b=330673 r+sr=roc

git-svn-id: svn://10.0.0.236/trunk@217713 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2007-01-04 04:44:42 +00:00
parent a6fe0f6902
commit cd06827bdd

View File

@@ -2161,11 +2161,12 @@ nsXULScrollFrame::Layout(nsBoxLayoutState& aState)
// now look at the content area and see if we need scrollbars or not
PRBool needsLayout = PR_FALSE;
nsRect scrolledRect = mInner.GetScrolledRect(scrollAreaRect.Size());
nsSize scrolledContentSize(scrolledRect.XMost(), scrolledRect.YMost());
// if we have 'auto' scrollbars look at the vertical case
if (styles.mVertical != NS_STYLE_OVERFLOW_SCROLL) {
// These are only good until the call to LayoutScrollArea.
nsRect scrolledRect = mInner.GetScrolledRect(scrollAreaRect.Size());
nsSize scrolledContentSize(scrolledRect.XMost(), scrolledRect.YMost());
// There are two cases to consider
if (scrolledContentSize.height <= scrollAreaRect.height
|| styles.mVertical != NS_STYLE_OVERFLOW_AUTO) {
@@ -2196,6 +2197,10 @@ nsXULScrollFrame::Layout(nsBoxLayoutState& aState)
// if scrollbars are auto look at the horizontal case
if (styles.mHorizontal != NS_STYLE_OVERFLOW_SCROLL)
{
// These are only good until the call to LayoutScrollArea.
nsRect scrolledRect = mInner.GetScrolledRect(scrollAreaRect.Size());
nsSize scrolledContentSize(scrolledRect.XMost(), scrolledRect.YMost());
// if the child is wider that the scroll area
// and we don't have a scrollbar add one.
if (scrolledContentSize.width > scrollAreaRect.width