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; } }