Improved height calculation when there are floaters. Now we check against

the content area y-most rather than the frame bounds y-most. This ensures
that border and padding are respected along the bottom edge
This commit is contained in:
troy%netscape.com 1998-12-08 00:01:12 +00:00
parent 1871d64a59
commit 7cf1fde73d

View File

@ -272,12 +272,25 @@ nsBodyFrame::Reflow(nsIPresContext& aPresContext,
// Compute our desired size. Take into account any floaters when computing the
// height
if (mSpaceManager->YMost() > aDesiredSize.height) {
aDesiredSize.height = mSpaceManager->YMost();
nscoord floaterYMost = mSpaceManager->YMost();
if (floaterYMost > 0) {
// What we need to check for is if the bottom most floater extends below
// the content area of the desired size
nsMargin borderPadding;
nscoord contentYMost;
nsHTMLReflowState::ComputeBorderPaddingFor(this, aReflowState.parentReflowState,
borderPadding);
contentYMost = aDesiredSize.height - borderPadding.bottom;
if (floaterYMost > contentYMost) {
aDesiredSize.height += floaterYMost - contentYMost;
}
}
// Also take into account absolutely positioned elements
const nsStyleDisplay* display= (const nsStyleDisplay*)
// Also take into account absolutely positioned elements depending on
// the overflow policy
const nsStyleDisplay* display = (const nsStyleDisplay*)
mStyleContext->GetStyleData(eStyleStruct_Display);
if (NS_STYLE_OVERFLOW_HIDDEN != display->mOverflow) {