From 75458d92cbd31da6f0ead36611d068de0bd023f1 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Thu, 25 Mar 1999 03:48:30 +0000 Subject: [PATCH] Fixed up area frame sizing calculations to properly compute the final height git-svn-id: svn://10.0.0.236/trunk@25049 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsAreaFrame.cpp | 7 ++++--- mozilla/layout/html/base/src/nsAreaFrame.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/generic/nsAreaFrame.cpp b/mozilla/layout/generic/nsAreaFrame.cpp index 0154ed9a2ed..7e763babddc 100644 --- a/mozilla/layout/generic/nsAreaFrame.cpp +++ b/mozilla/layout/generic/nsAreaFrame.cpp @@ -518,11 +518,12 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext, // frame has a height specified by CSS then we don't do this! if ((NS_UNCONSTRAINEDSIZE == reflowState.computedHeight) && (NS_FRAME_OUTSIDE_CHILDREN & mState)) { - nscoord contentYMost = aDesiredSize.height - - aReflowState.mComputedBorderPadding.bottom; + nscoord contentYMost = aDesiredSize.height; nscoord yMost = aDesiredSize.mCombinedArea.YMost(); if (yMost > contentYMost) { - aDesiredSize.height += yMost - contentYMost; + // retain the border+padding for this element after the bottom + // most object. + aDesiredSize.height = yMost; } } diff --git a/mozilla/layout/html/base/src/nsAreaFrame.cpp b/mozilla/layout/html/base/src/nsAreaFrame.cpp index 0154ed9a2ed..7e763babddc 100644 --- a/mozilla/layout/html/base/src/nsAreaFrame.cpp +++ b/mozilla/layout/html/base/src/nsAreaFrame.cpp @@ -518,11 +518,12 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext, // frame has a height specified by CSS then we don't do this! if ((NS_UNCONSTRAINEDSIZE == reflowState.computedHeight) && (NS_FRAME_OUTSIDE_CHILDREN & mState)) { - nscoord contentYMost = aDesiredSize.height - - aReflowState.mComputedBorderPadding.bottom; + nscoord contentYMost = aDesiredSize.height; nscoord yMost = aDesiredSize.mCombinedArea.YMost(); if (yMost > contentYMost) { - aDesiredSize.height += yMost - contentYMost; + // retain the border+padding for this element after the bottom + // most object. + aDesiredSize.height = yMost; } }