From a85772433d0ee6ebc39844a12d51443f58ce4d62 Mon Sep 17 00:00:00 2001 From: "emaijala%kolumbus.fi" Date: Fri, 28 Jan 2005 16:24:09 +0000 Subject: [PATCH] Fix for bug 212034: Page break before huge table row inconsistent in print, preview, XP, Linux r+sr=roc git-svn-id: svn://10.0.0.236/trunk@168447 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsBlockFrame.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 4348b584850..cbcc17af37e 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -1361,8 +1361,12 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, if (aState.GetFlag(BRS_ISBOTTOMMARGINROOT)) { // When we are a bottom-margin root make sure that our last // childs bottom margin is fully applied. - // XXX check for a fit - autoHeight += aState.mPrevBottomMargin.get(); + // Apply the margin only if there's space for it. + if (autoHeight < aState.mReflowState.availableHeight) + { + // Truncate bottom margin if it doesn't fit to our available height. + autoHeight = PR_MIN(autoHeight + aState.mPrevBottomMargin.get(), aState.mReflowState.availableHeight); + } } if (NS_BLOCK_SPACE_MGR & mState) {