From c3d0ada98b6a114ae97d9e4ac84f2da35870ef54 Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Wed, 30 Mar 2005 20:31:13 +0000 Subject: [PATCH] Bug 285348. Fix reflow of nested columns by ensuring that if a column overflows, its next-in-flow gets reflowed *even if* that next in flow belongs to continuation of the column set --- layout/generic/nsColumnSetFrame.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index cd1b79245c4..4f34df84e9b 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -405,8 +405,11 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize, && (!child->GetNextSibling() || !(child->GetNextSibling()->GetStateBits() & NS_FRAME_IS_DIRTY)) && !aDesiredSize.mComputeMEW; + // If we need to pull up content from the prev-in-flow then this is not just + // a height shrink. The prev in flow will have set the dirty bit. PRBool skipResizeHeightShrink = shrinkingHeightOnly - && child->GetSize().height <= aConfig.mColMaxHeight; + && child->GetSize().height <= aConfig.mColMaxHeight + && !(child->GetStateBits() & NS_FRAME_IS_DIRTY); if (!reflowNext && (skipIncremental || skipResizeHeightShrink)) { // This child does not need to be reflowed, but we may need to move it MoveChildTo(this, child, childOrigin); @@ -516,15 +519,14 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize, "We have to create a continuation, but the block doesn't want us to reflow it?"); // We need to create a continuing column - nsIFrame* continuation; - nsresult rv = CreateNextInFlow(GetPresContext(), this, child, continuation); + nsresult rv = CreateNextInFlow(GetPresContext(), this, child, kidNextInFlow); if (NS_FAILED(rv)) { NS_NOTREACHED("Couldn't create continuation"); break; } - continuation->AddStateBits(NS_BLOCK_SPACE_MGR); + kidNextInFlow->AddStateBits(NS_BLOCK_SPACE_MGR); // Do an initial reflow if we're going to reflow this thing. aKidReason = eReflowReason_Initial; @@ -533,6 +535,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize, if (columnCount >= aConfig.mBalanceColCount) { // No more columns allowed here. Stop. aStatus |= NS_FRAME_REFLOW_NEXTINFLOW; + kidNextInFlow->AddStateBits(NS_FRAME_IS_DIRTY); // Move any of our leftover columns to our overflow list. Our // next-in-flow will eventually pick them up.