mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Report incomplete reflow status as appropriate when frame tree is too deep. (Bug 619021) r=roc a2.0=blocking
This commit is contained in:
parent
798ba3541e
commit
4793ae3bb5
@ -993,8 +993,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
// delete the line with the line cursor.
|
||||
ClearLineCursor();
|
||||
|
||||
if (IsFrameTreeTooDeep(aReflowState, aMetrics)) {
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
if (IsFrameTreeTooDeep(aReflowState, aMetrics, aStatus)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -4551,7 +4551,8 @@ nsIFrame::CheckInvalidateSizeChange(const nsRect& aOldRect,
|
||||
|
||||
PRBool
|
||||
nsFrame::IsFrameTreeTooDeep(const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aMetrics)
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
if (aReflowState.mReflowDepth > MAX_FRAME_DEPTH) {
|
||||
NS_WARNING("frame tree too deep; setting zero size and returning");
|
||||
@ -4562,6 +4563,16 @@ nsFrame::IsFrameTreeTooDeep(const nsHTMLReflowState& aReflowState,
|
||||
aMetrics.ascent = 0;
|
||||
aMetrics.mCarriedOutBottomMargin.Zero();
|
||||
aMetrics.mOverflowAreas.Clear();
|
||||
|
||||
if (GetNextInFlow()) {
|
||||
// Reflow depth might vary between reflows, so we might have
|
||||
// successfully reflowed and split this frame before. If so, we
|
||||
// shouldn't delete its continuations.
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
} else {
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
mState &= ~NS_FRAME_TOO_DEEP_IN_FRAME_TREE;
|
||||
|
@ -386,13 +386,14 @@ public:
|
||||
*/
|
||||
void CheckInvalidateSizeChange(nsHTMLReflowMetrics& aNewDesiredSize);
|
||||
|
||||
// Helper function that tests if the frame tree is too deep; if it
|
||||
// is it marks the frame as "unflowable" and zeros out the metrics
|
||||
// and returns PR_TRUE. Otherwise, the frame is unmarked
|
||||
// "unflowable" and the metrics are not touched and PR_FALSE is
|
||||
// returned.
|
||||
// Helper function that tests if the frame tree is too deep; if it is
|
||||
// it marks the frame as "unflowable", zeroes out the metrics, sets
|
||||
// the reflow status, and returns PR_TRUE. Otherwise, the frame is
|
||||
// unmarked "unflowable" and the metrics and reflow status are not
|
||||
// touched and PR_FALSE is returned.
|
||||
PRBool IsFrameTreeTooDeep(const nsHTMLReflowState& aReflowState,
|
||||
nsHTMLReflowMetrics& aMetrics);
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// Do the work for getting the parent style context frame so that
|
||||
// other frame's |GetParentStyleContextFrame| methods can call this
|
||||
|
@ -392,8 +392,7 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
if (IsFrameTreeTooDeep(aReflowState, aMetrics)) {
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
if (IsFrameTreeTooDeep(aReflowState, aMetrics, aStatus)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user