From cd06827bdd544da770e08bb2fe1f1ea73fe3bb92 Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Thu, 4 Jan 2007 04:44:42 +0000 Subject: [PATCH] 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 --- mozilla/layout/generic/nsGfxScrollFrame.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mozilla/layout/generic/nsGfxScrollFrame.cpp b/mozilla/layout/generic/nsGfxScrollFrame.cpp index 71c8817521e..169068feead 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.cpp +++ b/mozilla/layout/generic/nsGfxScrollFrame.cpp @@ -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