From 55cb6eedb809709e245ee0fec5afba9559a58fdb Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Sat, 21 Nov 1998 03:52:01 +0000 Subject: [PATCH] Fixed scroll-frame code to properly fill in the max-element-size --- layout/html/base/src/nsScrollFrame.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/layout/html/base/src/nsScrollFrame.cpp b/layout/html/base/src/nsScrollFrame.cpp index 4be8e3b9633f..fb8e3239795c 100644 --- a/layout/html/base/src/nsScrollFrame.cpp +++ b/layout/html/base/src/nsScrollFrame.cpp @@ -338,7 +338,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, nsSize kidReflowSize(scrollAreaSize.width, NS_UNCONSTRAINEDSIZE); nsHTMLReflowState kidReflowState(aPresContext, mFirstChild, aReflowState, kidReflowSize); - nsHTMLReflowMetrics kidDesiredSize(nsnull); + nsHTMLReflowMetrics kidDesiredSize(aDesiredSize.maxElementSize); ReflowChild(mFirstChild, aPresContext, kidDesiredSize, kidReflowState, aStatus); NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status"); @@ -405,6 +405,15 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext, aDesiredSize.height += NSToCoordRound(sbHeight); } + if (nsnull != aDesiredSize.maxElementSize) { + nscoord maxWidth = aDesiredSize.maxElementSize->width; + maxWidth += border.left + border.right + NSToCoordRound(sbWidth); + nscoord maxHeight = aDesiredSize.maxElementSize->height; + maxHeight += border.top + border.bottom; + aDesiredSize.maxElementSize->width = maxWidth; + aDesiredSize.maxElementSize->height = maxHeight; + } + aDesiredSize.ascent = aDesiredSize.height; aDesiredSize.descent = 0;