b=21657. Changed row frame code to correctly determine if it's complete

after an incremental reflow. Fixes crash when printing www.cnn.com
This commit is contained in:
troy%netscape.com 2000-01-17 17:45:17 +00:00
Родитель f408d688d2
Коммит eb5888e444
4 изменённых файлов: 46 добавлений и 4 удалений

Просмотреть файл

@ -1309,6 +1309,22 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
{ // pass reflow to unknown frame child
// aDesiredSize does not change
}
// When returning whether we're complete we need to look at each of our cell
// frames. If any of them has a continuing frame, then we're not complete. We
// can't just return the status of the cell frame we just reflowed...
aStatus = NS_FRAME_COMPLETE;
if (mNextInFlow) {
for (nsIFrame* cell = mFrames.FirstChild(); cell; cell->GetNextSibling(&cell)) {
nsIFrame* contFrame;
cell->GetNextInFlow(&contFrame);
if (contFrame) {
aStatus = NS_FRAME_NOT_COMPLETE;
break;
}
}
}
return rv;
}

Просмотреть файл

@ -1449,6 +1449,7 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsChild(nsIPresContext* aPresConte
{
nsresult rv;
// Recover the state as if aNextFrame is about to be reflowed
RecoverState(aReflowState, aNextFrame, aDesiredSize.maxElementSize);
@ -1456,12 +1457,16 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsChild(nsIPresContext* aPresConte
nsRect oldKidRect;
aNextFrame->GetRect(oldKidRect);
// Pass along the reflow command
// Reflow the child giving it as much room as it wants. We'll deal with
// splitting later after final determination of rows heights taking into
// account cells with row spans...
nsSize kidAvailSize(aReflowState.availSize.width, NS_UNCONSTRAINEDSIZE);
nsHTMLReflowState kidReflowState(aPresContext, aReflowState.reflowState,
aNextFrame, aReflowState.availSize);
aNextFrame, kidAvailSize);
nsSize kidMaxElementSize;
nsHTMLReflowMetrics desiredSize(aDesiredSize.maxElementSize ? &kidMaxElementSize : nsnull);
// Pass along the reflow command
rv = ReflowChild(aNextFrame, aPresContext, desiredSize, kidReflowState,
0, aReflowState.y, 0, aStatus);

Просмотреть файл

@ -1309,6 +1309,22 @@ NS_METHOD nsTableRowFrame::IR_TargetIsChild(nsIPresContext* aPresContext,
{ // pass reflow to unknown frame child
// aDesiredSize does not change
}
// When returning whether we're complete we need to look at each of our cell
// frames. If any of them has a continuing frame, then we're not complete. We
// can't just return the status of the cell frame we just reflowed...
aStatus = NS_FRAME_COMPLETE;
if (mNextInFlow) {
for (nsIFrame* cell = mFrames.FirstChild(); cell; cell->GetNextSibling(&cell)) {
nsIFrame* contFrame;
cell->GetNextInFlow(&contFrame);
if (contFrame) {
aStatus = NS_FRAME_NOT_COMPLETE;
break;
}
}
}
return rv;
}

Просмотреть файл

@ -1449,6 +1449,7 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsChild(nsIPresContext* aPresConte
{
nsresult rv;
// Recover the state as if aNextFrame is about to be reflowed
RecoverState(aReflowState, aNextFrame, aDesiredSize.maxElementSize);
@ -1456,12 +1457,16 @@ NS_METHOD nsTableRowGroupFrame::IR_TargetIsChild(nsIPresContext* aPresConte
nsRect oldKidRect;
aNextFrame->GetRect(oldKidRect);
// Pass along the reflow command
// Reflow the child giving it as much room as it wants. We'll deal with
// splitting later after final determination of rows heights taking into
// account cells with row spans...
nsSize kidAvailSize(aReflowState.availSize.width, NS_UNCONSTRAINEDSIZE);
nsHTMLReflowState kidReflowState(aPresContext, aReflowState.reflowState,
aNextFrame, aReflowState.availSize);
aNextFrame, kidAvailSize);
nsSize kidMaxElementSize;
nsHTMLReflowMetrics desiredSize(aDesiredSize.maxElementSize ? &kidMaxElementSize : nsnull);
// Pass along the reflow command
rv = ReflowChild(aNextFrame, aPresContext, desiredSize, kidReflowState,
0, aReflowState.y, 0, aStatus);