From cde473408da84d18eca4e4519c7de8ab777609e3 Mon Sep 17 00:00:00 2001 From: "bzbarsky@mit.edu" Date: Mon, 8 Oct 2007 19:39:06 -0700 Subject: [PATCH] Make sure to not propagate special height reflows too far. Bug 391901, r+sr+a=dbaron --- layout/tables/nsTableCellFrame.cpp | 3 +++ layout/tables/nsTableFrame.cpp | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index d04fd39c5f4f..77515482d3bc 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -839,6 +839,9 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext, // but only those than are tables in standards mode. NeedsToObserve // will determine how far this is propagated to descendants. kidReflowState.mPercentHeightObserver = this; + // Don't propagate special height reflow state to our kids + kidReflowState.mFlags.mSpecialHeightReflow = PR_FALSE; + if (aReflowState.mFlags.mSpecialHeightReflow || (GetFirstInFlow()->GetStateBits() & NS_TABLE_CELL_HAD_SPECIAL_REFLOW)) { // We need to force the kid to have mVResize set if we've had a diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 370428474447..9e7ff425578f 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -1883,10 +1883,8 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, } nsIFrame* lastChildReflowed = nsnull; - nsHTMLReflowState &mutable_rs = - const_cast(aReflowState); - PRBool oldSpecialHeightReflow = mutable_rs.mFlags.mSpecialHeightReflow; - mutable_rs.mFlags.mSpecialHeightReflow = PR_FALSE; + NS_ASSERTION(!aReflowState.mFlags.mSpecialHeightReflow, + "Shouldn't be in special height reflow here!"); // do the pass 2 reflow unless this is a special height reflow and we will be // initiating a special height reflow @@ -1909,6 +1907,9 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, if (needToInitiateSpecialReflow && NS_FRAME_IS_COMPLETE(aStatus)) { // XXXldb Do we need to set the mVResize flag on any reflow states? + nsHTMLReflowState &mutable_rs = + const_cast(aReflowState); + // distribute extra vertical space to rows CalcDesiredHeight(aReflowState, aDesiredSize); mutable_rs.mFlags.mSpecialHeightReflow = PR_TRUE; @@ -1929,9 +1930,9 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, } haveDesiredHeight = PR_TRUE; reflowedChildren = PR_TRUE; - } - mutable_rs.mFlags.mSpecialHeightReflow = oldSpecialHeightReflow; + mutable_rs.mFlags.mSpecialHeightReflow = PR_FALSE; + } } aDesiredSize.width = aReflowState.ComputedWidth() + @@ -6130,7 +6131,6 @@ nsTableFrame::PaintBCBorders(nsIRenderingContext& aRenderingContext, nsTableRowGroupFrame* inFlowRG = nsnull; nsTableRowFrame* inFlowRow = nsnull; // find startRowIndex, endRowIndex, startRowY - nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1); PRInt32 rowY = startRowY; for (PRUint32 rgX = 0; rgX < rowGroups.Length() && !done; rgX++) { nsTableRowGroupFrame* rgFrame = rowGroups[rgX];