bug 78162 - don't optimize resize reflow on cell if its desired size exceeds its last avail size, sr=timeout, r=alexsavulov

This commit is contained in:
karnaze@netscape.com
2001-08-06 14:04:58 +00:00
parent d52f666021
commit ed95b8f597
2 changed files with 16 additions and 10 deletions

View File

@@ -828,13 +828,16 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext,
prevColIndex = (iter.IsLeftToRight()) ? cellColIndex + (cellColSpan - 1) : cellColIndex; prevColIndex = (iter.IsLeftToRight()) ? cellColIndex + (cellColSpan - 1) : cellColIndex;
nsHTMLReflowMetrics desiredSize(nsnull); nsHTMLReflowMetrics desiredSize(nsnull);
// If the available width is the same as last time we reflowed the cell,then // If the avail width is not the same as last time we reflowed the cell or
// use the previous desired size and max element size (else clause). We can't // the cell wants to be bigger than what was available last time or
// do this in paganated mode or for a style change reflow. // it is a style change reflow or we are printing, then we must reflow the
// cell. Otherwise we can skip the reflow.
nsIFrame* kidNextInFlow; nsIFrame* kidNextInFlow;
kidFrame->GetNextInFlow(&kidNextInFlow); kidFrame->GetNextInFlow(&kidNextInFlow);
if ((availWidth != cellFrame->GetPriorAvailWidth()) || nsSize cellDesiredSize = cellFrame->GetDesiredSize();
(eReflowReason_StyleChange == aReflowState.reason) || if ((availWidth != cellFrame->GetPriorAvailWidth()) ||
(cellDesiredSize.width > cellFrame->GetPriorAvailWidth()) ||
(eReflowReason_StyleChange == aReflowState.reason) ||
isPaginated) { isPaginated) {
// Reflow the cell to fit the available width, height // Reflow the cell to fit the available width, height
nsSize kidAvailSize(availWidth, aReflowState.availableHeight); nsSize kidAvailSize(availWidth, aReflowState.availableHeight);

View File

@@ -828,13 +828,16 @@ nsTableRowFrame::ReflowChildren(nsIPresContext* aPresContext,
prevColIndex = (iter.IsLeftToRight()) ? cellColIndex + (cellColSpan - 1) : cellColIndex; prevColIndex = (iter.IsLeftToRight()) ? cellColIndex + (cellColSpan - 1) : cellColIndex;
nsHTMLReflowMetrics desiredSize(nsnull); nsHTMLReflowMetrics desiredSize(nsnull);
// If the available width is the same as last time we reflowed the cell,then // If the avail width is not the same as last time we reflowed the cell or
// use the previous desired size and max element size (else clause). We can't // the cell wants to be bigger than what was available last time or
// do this in paganated mode or for a style change reflow. // it is a style change reflow or we are printing, then we must reflow the
// cell. Otherwise we can skip the reflow.
nsIFrame* kidNextInFlow; nsIFrame* kidNextInFlow;
kidFrame->GetNextInFlow(&kidNextInFlow); kidFrame->GetNextInFlow(&kidNextInFlow);
if ((availWidth != cellFrame->GetPriorAvailWidth()) || nsSize cellDesiredSize = cellFrame->GetDesiredSize();
(eReflowReason_StyleChange == aReflowState.reason) || if ((availWidth != cellFrame->GetPriorAvailWidth()) ||
(cellDesiredSize.width > cellFrame->GetPriorAvailWidth()) ||
(eReflowReason_StyleChange == aReflowState.reason) ||
isPaginated) { isPaginated) {
// Reflow the cell to fit the available width, height // Reflow the cell to fit the available width, height
nsSize kidAvailSize(availWidth, aReflowState.availableHeight); nsSize kidAvailSize(availWidth, aReflowState.availableHeight);