From 313dd1a271c794b0b4dc92f9e9065642d161de3c Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 9 Oct 2007 02:39:06 +0000 Subject: [PATCH] Make sure to not propagate special height reflows too far. Bug 391901, r+sr+a=dbaron git-svn-id: svn://10.0.0.236/trunk@237442 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/tables/nsTableCellFrame.cpp | 3 +++ mozilla/layout/tables/nsTableFrame.cpp | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index d04fd39c5f4..77515482d3b 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/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/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 37042847444..9e7ff425578 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/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];