From cc7c8c39e901b94347e701778ec5acb48fe38153 Mon Sep 17 00:00:00 2001 From: "bmlk@gmx.de" Date: Sun, 21 Jan 2007 17:51:33 +0000 Subject: [PATCH] Stronger band-aid to prevent table splitting inside columns bug 362275 r/sr=roc --- layout/generic/nsColumnSetFrame.cpp | 1 + layout/generic/nsHTMLReflowState.cpp | 1 + layout/generic/nsHTMLReflowState.h | 2 ++ layout/generic/nsPageFrame.cpp | 1 + layout/tables/nsTableRowGroupFrame.cpp | 2 +- 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index b3debef02e98..4b3637aa47ff 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -431,6 +431,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize, availSize, availSize.width, aReflowState.mComputedHeight); kidReflowState.mFlags.mIsTopOfPage = PR_TRUE; + kidReflowState.mFlags.mTableIsSplittable = PR_FALSE; #ifdef DEBUG_roc printf("*** Reflowing child #%d %p: availHeight=%d\n", diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index 940964d967dc..279303b9d369 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -100,6 +100,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsPresContext* aPresContext, mLineLayout = nsnull; mFlags.mSpecialHeightReflow = PR_FALSE; mFlags.mIsTopOfPage = PR_FALSE; + mFlags.mTableIsSplittable = PR_FALSE; mFlags.mNextInFlowUntouched = PR_FALSE; mFlags.mAssumingHScrollbar = mFlags.mAssumingVScrollbar = PR_FALSE; mFlags.mHasClearance = PR_FALSE; diff --git a/layout/generic/nsHTMLReflowState.h b/layout/generic/nsHTMLReflowState.h index 0eaefc49989a..81f0e10fa848 100644 --- a/layout/generic/nsHTMLReflowState.h +++ b/layout/generic/nsHTMLReflowState.h @@ -318,6 +318,8 @@ struct nsHTMLReflowState : public nsCSSOffsetState { // (potentially) in a context where // percent heights have a different // basis? + PRUint16 mTableIsSplittable:1; // tables are splittable, this should happen only inside a page + // and never insider a column frame } mFlags; #ifdef IBMBIDI diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index 674442a4f0c2..8d79f523cfbc 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -147,6 +147,7 @@ NS_IMETHODIMP nsPageFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowState kidReflowState(aPresContext, aReflowState, frame, maxSize); kidReflowState.mFlags.mIsTopOfPage = PR_TRUE; + kidReflowState.mFlags.mTableIsSplittable = PR_TRUE; // calc location of frame nscoord xc = mPD->mReflowMargin.left + mPD->mExtraMargin.left; diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 9fcae26a808a..4ee758bd7bef 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -1286,7 +1286,7 @@ nsTableRowGroupFrame::Reflow(nsPresContext* aPresContext, // See if all the frames fit. Do not try to split anything if we're // not paginated ... we can't split across columns yet. - if (aPresContext->IsPaginated() && + if (aReflowState.mFlags.mTableIsSplittable && (NS_FRAME_NOT_COMPLETE == aStatus || splitDueToPageBreak || aDesiredSize.height > aReflowState.availableHeight)) { // Nope, find a place to split the row group