Added IsFrameTreeTooDeep method to support code handling bug #10310

git-svn-id: svn://10.0.0.236/trunk@44924 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1999-08-27 21:48:06 +00:00
parent dd5de649f5
commit 4a17fe8915
4 changed files with 72 additions and 0 deletions

View File

@@ -1326,6 +1326,34 @@ nsFrame::Invalidate(const nsRect& aDamageRect,
NS_IF_RELEASE(viewManager);
}
#define MAX_REFLOW_DEPTH 500
PRBool
nsFrame::IsFrameTreeTooDeep(const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aMetrics)
{
if (aReflowState.mReflowDepth > MAX_REFLOW_DEPTH) {
mState |= NS_FRAME_IS_UNFLOWABLE;
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
aMetrics.width = 0;
aMetrics.height = 0;
aMetrics.ascent = 0;
aMetrics.descent = 0;
aMetrics.mCarriedOutBottomMargin = 0;
aMetrics.mCombinedArea.x = 0;
aMetrics.mCombinedArea.y = 0;
aMetrics.mCombinedArea.width = 0;
aMetrics.mCombinedArea.height = 0;
if (aMetrics.maxElementSize) {
aMetrics.maxElementSize->width = 0;
aMetrics.maxElementSize->height = 0;
}
return PR_TRUE;
}
mState &= ~NS_FRAME_IS_UNFLOWABLE;
return PR_FALSE;
}
// Style sizing methods
NS_IMETHODIMP nsFrame::IsPercentageBase(PRBool& aBase) const
{