Bug 468771. Make sure to reflow the last column of a column-set if we're changing its height to be unbounded; it needs to pull all the content from the extra column, if there is one. r+sr=dbaron

--HG--
extra : rebase_source : a285d26735ef7c0cddb0f8ff21504c52cd4346fc
This commit is contained in:
Robert O'Callahan 2009-02-11 14:20:59 +13:00
parent 8ddfeb2aa2
commit 43fb31a6c8

View File

@ -580,10 +580,17 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
// Try to skip reflowing the child. We can't skip if the child is dirty. We also can't
// skip if the next column is dirty, because the next column's first line(s)
// might be pullable back to this column. We can't skip if it's the last child
// because we need to obtain the bottom margin.
// because we need to obtain the bottom margin. We can't skip
// if this is the last column and we're supposed to assign unbounded
// height to it, because that could change the available height from
// the last time we reflowed it and we should try to pull all the
// content from its next sibling. (Note that it might be the last
// column, but not be the last child because the desired number of columns
// has changed.)
PRBool skipIncremental = !(GetStateBits() & NS_FRAME_IS_DIRTY)
&& !NS_SUBTREE_DIRTY(child)
&& child->GetNextSibling()
&& !(aUnboundedLastColumn && columnCount == aConfig.mBalanceColCount - 1)
&& !NS_SUBTREE_DIRTY(child->GetNextSibling());
// 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.
@ -1018,6 +1025,10 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus) ||
aReflowState.availableHeight != NS_UNCONSTRAINEDSIZE,
"Column set should be complete if the available height is unconstrained");
return NS_OK;
}