From 97891adcdc23b6c7635a46b28fd6bd4eeb25f268 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Mon, 1 Feb 1999 16:32:54 +0000 Subject: [PATCH] Fixed logic that determines whether there's currently a visible vertical scrollbar git-svn-id: svn://10.0.0.236/trunk@19161 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/html/base/src/nsScrollFrame.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mozilla/layout/html/base/src/nsScrollFrame.cpp b/mozilla/layout/html/base/src/nsScrollFrame.cpp index da1a3bb0385..b823b71b153 100644 --- a/mozilla/layout/html/base/src/nsScrollFrame.cpp +++ b/mozilla/layout/html/base/src/nsScrollFrame.cpp @@ -299,9 +299,19 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, // we must give the frame being reflowed the same amount of available // width; otherwise, it's not only just an incremental reflow but also // a resize reflow + nsSize oldScrollSize(mRect.width, mRect.height); nsSize kidSize; + kidFrame->GetSize(kidSize); - if (kidSize.height > scrollAreaSize.height) { + oldScrollSize.width -= border.left + border.right; + oldScrollSize.height -= border.top + border.bottom; + + if (kidSize.width > oldScrollSize.width) { + // Horizontal scrollbar is showing + oldScrollSize.height -= NSToCoordRound(sbHeight); + } + + if (kidSize.height > oldScrollSize.height) { roomForVerticalScrollbar = PR_TRUE; } }