mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
Keep trakc of the depth of reflow to allow for limiting stack usage (bug #10310)
This commit is contained in:
parent
a990e6fdbf
commit
06e81276ec
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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...
|
||||
|
Loading…
Reference in New Issue
Block a user