fix use of DEBUG-only data member, bug=154892 r+sr+a=roc

This commit is contained in:
fantasai.cvs@inkedblade.net 2007-10-02 01:29:23 -07:00
parent 77bec1d48d
commit 678b52fb1e
6 changed files with 17 additions and 7 deletions

View File

@ -143,6 +143,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
nsReflowStatus& aReflowStatus,
nscoord aContainingBlockWidth,
nscoord aContainingBlockHeight,
PRBool aConstrainHeight,
PRBool aCBWidthChanged,
PRBool aCBHeightChanged,
nsRect* aChildBounds)
@ -164,7 +165,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
nsReflowStatus kidStatus = NS_FRAME_COMPLETE;
ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowState,
aContainingBlockWidth, aContainingBlockHeight,
kidFrame, kidStatus, aChildBounds);
aConstrainHeight, kidFrame, kidStatus, aChildBounds);
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
if (!NS_FRAME_IS_FULLY_COMPLETE(kidStatus)) {
// Need a continuation
@ -358,6 +359,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
const nsHTMLReflowState& aReflowState,
nscoord aContainingBlockWidth,
nscoord aContainingBlockHeight,
PRBool aConstrainHeight,
nsIFrame* aKidFrame,
nsReflowStatus& aStatus,
nsRect* aChildBounds)
@ -415,8 +417,8 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
aKidFrame->WillReflow(aPresContext);
PRBool constrainHeight = (aReflowState.availableHeight != NS_UNCONSTRAINEDSIZE)
&& (nsGkAtoms::fixedList != GetChildListName())
// Don't split fixed frames
&& aConstrainHeight
// Don't split if told not to (e.g. for fixed frames)
&& (aDelegatingFrame->GetType() != nsGkAtoms::positionedInlineFrame)
//XXX we don't handle splitting frames for inline absolute containing blocks yet
&& (aKidFrame->GetRect().y <= aReflowState.availableHeight);

View File

@ -71,14 +71,18 @@ class nsAbsoluteContainingBlock
{
public:
nsAbsoluteContainingBlock(nsIAtom* aChildListName)
#ifdef DEBUG
: mChildListName(aChildListName)
#endif
{
NS_ASSERTION(mChildListName == nsGkAtoms::absoluteList ||
mChildListName == nsGkAtoms::fixedList,
"should either represent position:fixed or absolute content");
}
#ifdef DEBUG
nsIAtom* GetChildListName() const { return mChildListName; }
#endif
nsresult FirstChild(const nsIFrame* aDelegatingFrame,
nsIAtom* aListName,
@ -116,6 +120,7 @@ public:
nsReflowStatus& aReflowStatus,
nscoord aContainingBlockWidth,
nscoord aContainingBlockHeight,
PRBool aConstrainHeight,
PRBool aCBWidthChanged,
PRBool aCBHeightChanged,
nsRect* aChildBounds = nsnull);
@ -137,6 +142,7 @@ protected:
const nsHTMLReflowState& aReflowState,
nscoord aContainingBlockWidth,
nscoord aContainingBlockHeight,
PRBool aConstrainHeight,
nsIFrame* aKidFrame,
nsReflowStatus& aStatus,
nsRect* aChildBounds);
@ -144,11 +150,13 @@ protected:
protected:
nsFrameList mAbsoluteFrames; // additional named child list
#ifdef DEBUG
nsIAtom* const mChildListName; // nsGkAtoms::fixedList or nsGkAtoms::absoluteList
// helper routine for debug printout
void PrettyUC(nscoord aSize,
char* aBuf);
#endif
};
#endif /* nsnsAbsoluteContainingBlock_h___ */

View File

@ -1136,7 +1136,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
rv = mAbsoluteContainer.Reflow(this, aPresContext, aReflowState,
state.mReflowStatus,
containingBlockSize.width,
containingBlockSize.height,
containingBlockSize.height, PR_TRUE,
cbWidthChanged, cbHeightChanged,
&childBounds);

View File

@ -1133,7 +1133,7 @@ nsPositionedInlineFrame::Reflow(nsPresContext* aPresContext,
// That will all be done by nsLineLayout::RelativePositionFrames.
rv = mAbsoluteContainer.Reflow(this, aPresContext, aReflowState, aStatus,
containingBlockWidth, containingBlockHeight,
PR_TRUE, PR_TRUE, // XXX could be optimized
PR_TRUE, PR_TRUE, PR_TRUE, // XXX could be optimized
&aDesiredSize.mOverflowArea);
}

View File

@ -149,7 +149,7 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
mFixedContainer.Reflow(this, aPresContext, aReflowState, aStatus,
aReflowState.availableWidth,
aReflowState.availableHeight,
PR_TRUE, PR_TRUE); // XXX could be optimized
PR_FALSE, PR_TRUE, PR_TRUE); // XXX could be optimized
// Return our desired size
aDesiredSize.width = aReflowState.availableWidth;

View File

@ -319,7 +319,7 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
rv = mFixedContainer.Reflow(this, aPresContext, reflowState, aStatus,
reflowState.ComputedWidth(),
reflowState.ComputedHeight(),
PR_TRUE, PR_TRUE); // XXX could be optimized
PR_FALSE, PR_TRUE, PR_TRUE); // XXX could be optimized
// If we were dirty then do a repaint
if (GetStateBits() & NS_FRAME_IS_DIRTY) {