mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
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:
parent
f408d688d2
commit
eb5888e444
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user