Keep trakc of the depth of reflow to allow for limiting stack usage (bug #10310)

This commit is contained in:
kipp%netscape.com 1999-08-27 21:48:54 +00:00
parent a990e6fdbf
commit 06e81276ec
3 changed files with 12 additions and 0 deletions

View File

@ -41,6 +41,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext,
nsReflowReason aReason,
nsIRenderingContext* aRenderingContext,
const nsSize& aAvailableSpace)
: mReflowDepth(0)
{
NS_PRECONDITION(nsnull != aRenderingContext, "no rendering context");
@ -64,6 +65,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext,
nsIReflowCommand& aReflowCommand,
nsIRenderingContext* aRenderingContext,
const nsSize& aAvailableSpace)
: mReflowDepth(0)
{
NS_PRECONDITION(nsnull != aRenderingContext, "no rendering context");
@ -88,6 +90,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext,
nsIFrame* aFrame,
const nsSize& aAvailableSpace,
nsReflowReason aReason)
: mReflowDepth(aParentReflowState.mReflowDepth + 1)
{
parentReflowState = &aParentReflowState;
frame = aFrame;
@ -112,6 +115,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext,
const nsHTMLReflowState& aParentReflowState,
nsIFrame* aFrame,
const nsSize& aAvailableSpace)
: mReflowDepth(aParentReflowState.mReflowDepth + 1)
{
parentReflowState = &aParentReflowState;
frame = aFrame;

View File

@ -41,6 +41,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext,
nsReflowReason aReason,
nsIRenderingContext* aRenderingContext,
const nsSize& aAvailableSpace)
: mReflowDepth(0)
{
NS_PRECONDITION(nsnull != aRenderingContext, "no rendering context");
@ -64,6 +65,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext,
nsIReflowCommand& aReflowCommand,
nsIRenderingContext* aRenderingContext,
const nsSize& aAvailableSpace)
: mReflowDepth(0)
{
NS_PRECONDITION(nsnull != aRenderingContext, "no rendering context");
@ -88,6 +90,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext,
nsIFrame* aFrame,
const nsSize& aAvailableSpace,
nsReflowReason aReason)
: mReflowDepth(aParentReflowState.mReflowDepth + 1)
{
parentReflowState = &aParentReflowState;
frame = aFrame;
@ -112,6 +115,7 @@ nsHTMLReflowState::nsHTMLReflowState(nsIPresContext& aPresContext,
const nsHTMLReflowState& aParentReflowState,
nsIFrame* aFrame,
const nsSize& aAvailableSpace)
: mReflowDepth(aParentReflowState.mReflowDepth + 1)
{
parentReflowState = &aParentReflowState;
frame = aFrame;

View File

@ -197,6 +197,10 @@ struct nsHTMLReflowState : nsReflowState {
const nsStylePosition* mStylePosition;
const nsStyleSpacing* mStyleSpacing;
// This value keeps track of how deeply nested a given reflow state
// is from the top of the frame tree.
PRInt32 mReflowDepth;
// Note: The copy constructor is written by the compiler
// automatically. You can use that and then override specific values
// if you want, or you can call Init as desired...