From b09f29fdcc8d6bea91ad1ab2cb4fe7ccb939b9c0 Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Sun, 6 Jun 2004 20:45:23 +0000 Subject: [PATCH] Bug 241454. Enforce the rule that if a frame ever reflows its child asking for MEW, then it *always* reflows the child asking for MEW. r=bernd,sr=dbaron --- layout/html/table/src/nsTableRowFrame.cpp | 7 ++++--- layout/html/table/src/nsTableRowGroupFrame.cpp | 2 +- layout/tables/nsTableRowFrame.cpp | 7 ++++--- layout/tables/nsTableRowGroupFrame.cpp | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/layout/html/table/src/nsTableRowFrame.cpp b/layout/html/table/src/nsTableRowFrame.cpp index b32da342f98..98eead9f230 100644 --- a/layout/html/table/src/nsTableRowFrame.cpp +++ b/layout/html/table/src/nsTableRowFrame.cpp @@ -892,7 +892,10 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext, // remember the rightmost (ltr) or leftmost (rtl) column this cell spans into prevColIndex = (iter.IsLeftToRight()) ? cellColIndex + (cellColSpan - 1) : cellColIndex; - nsHTMLReflowMetrics desiredSize(PR_FALSE); + // always request MEW. Since we may turn MEW on for selected cells during incremental + // reflow, we need to request MEW *now* so that those incremental reflows will be + // able to build on existing MEW data in the children. + nsHTMLReflowMetrics desiredSize(PR_TRUE); // If the avail width is not the same as last time we reflowed the cell or // the cell wants to be bigger than what was available last time or @@ -936,8 +939,6 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext, if (NS_UNCONSTRAINEDSIZE != availCellWidth) { desiredSize.mFlags |= NS_REFLOW_CALC_MAX_WIDTH; } - // request to get the max element size - desiredSize.mComputeMEW = PR_TRUE; } else { cellToWatch = PR_FALSE; diff --git a/layout/html/table/src/nsTableRowGroupFrame.cpp b/layout/html/table/src/nsTableRowGroupFrame.cpp index 2268421067d..9e3d70a9655 100644 --- a/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -340,7 +340,7 @@ nsTableRowGroupFrame::ReflowChildren(nsIPresContext* aPresContext, nsSize kidAvailSize(aReflowState.availSize); if (0 >= kidAvailSize.height) kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet - nsHTMLReflowMetrics desiredSize(PR_FALSE); + nsHTMLReflowMetrics desiredSize(aDesiredSize.mComputeMEW); desiredSize.width = desiredSize.height = desiredSize.ascent = desiredSize.descent = 0; // Reflow the child into the available space, giving it as much height as diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index b32da342f98..98eead9f230 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -892,7 +892,10 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext, // remember the rightmost (ltr) or leftmost (rtl) column this cell spans into prevColIndex = (iter.IsLeftToRight()) ? cellColIndex + (cellColSpan - 1) : cellColIndex; - nsHTMLReflowMetrics desiredSize(PR_FALSE); + // always request MEW. Since we may turn MEW on for selected cells during incremental + // reflow, we need to request MEW *now* so that those incremental reflows will be + // able to build on existing MEW data in the children. + nsHTMLReflowMetrics desiredSize(PR_TRUE); // If the avail width is not the same as last time we reflowed the cell or // the cell wants to be bigger than what was available last time or @@ -936,8 +939,6 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext, if (NS_UNCONSTRAINEDSIZE != availCellWidth) { desiredSize.mFlags |= NS_REFLOW_CALC_MAX_WIDTH; } - // request to get the max element size - desiredSize.mComputeMEW = PR_TRUE; } else { cellToWatch = PR_FALSE; diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 2268421067d..9e3d70a9655 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -340,7 +340,7 @@ nsTableRowGroupFrame::ReflowChildren(nsIPresContext* aPresContext, nsSize kidAvailSize(aReflowState.availSize); if (0 >= kidAvailSize.height) kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet - nsHTMLReflowMetrics desiredSize(PR_FALSE); + nsHTMLReflowMetrics desiredSize(aDesiredSize.mComputeMEW); desiredSize.width = desiredSize.height = desiredSize.ascent = desiredSize.descent = 0; // Reflow the child into the available space, giving it as much height as