From 5a839584c78cf46c05d157645b7ff6802e33eecc Mon Sep 17 00:00:00 2001 From: troy Date: Tue, 12 May 1998 04:17:56 +0000 Subject: [PATCH] Change to nsIFrame API git-svn-id: svn://10.0.0.236/trunk@1441 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/public/nsIFrame.h | 43 +++++++--- mozilla/layout/base/public/nsIRunaround.h | 24 +++--- mozilla/layout/base/src/nsContainerFrame.cpp | 42 +++++---- mozilla/layout/base/src/nsContainerFrame.h | 24 +++--- mozilla/layout/base/src/nsFrame.cpp | 10 +-- mozilla/layout/base/src/nsFrame.h | 5 +- mozilla/layout/base/src/nsPresShell.cpp | 2 +- mozilla/layout/base/src/nsReflowCommand.cpp | 25 +++--- mozilla/layout/base/src/nsReflowCommand.h | 14 +-- mozilla/layout/base/src/nsSplittableFrame.h | 8 +- .../layout/base/tests/TestContainerFrame.cpp | 12 +-- mozilla/layout/generic/nsBlockFrame.cpp | 48 +++++------ mozilla/layout/generic/nsBlockFrame.h | 30 +++---- mozilla/layout/generic/nsBlockReflowState.cpp | 48 +++++------ mozilla/layout/generic/nsBlockReflowState.h | 48 +++++------ .../layout/generic/nsHTMLContainerFrame.cpp | 2 +- mozilla/layout/generic/nsIFrame.h | 43 +++++++--- mozilla/layout/generic/nsInlineFrame.cpp | 86 ++++++++++--------- mozilla/layout/generic/nsLeafFrame.cpp | 8 +- mozilla/layout/generic/nsLeafFrame.h | 4 +- mozilla/layout/generic/nsLineLayout.cpp | 6 +- mozilla/layout/generic/nsPageFrame.cpp | 10 +-- mozilla/layout/generic/nsPageFrame.h | 4 +- mozilla/layout/generic/nsPlaceholderFrame.cpp | 2 +- mozilla/layout/generic/nsPlaceholderFrame.h | 2 +- .../layout/html/base/src/deadnsInlineFrame.h | 38 ++++---- .../layout/html/base/src/nsAbsoluteFrame.cpp | 2 +- .../layout/html/base/src/nsAbsoluteFrame.h | 2 +- mozilla/layout/html/base/src/nsBRPart.cpp | 6 +- mozilla/layout/html/base/src/nsBlockFrame.cpp | 48 +++++------ mozilla/layout/html/base/src/nsBlockFrame.h | 30 +++---- .../html/base/src/nsBlockReflowState.cpp | 48 +++++------ .../layout/html/base/src/nsBlockReflowState.h | 48 +++++------ mozilla/layout/html/base/src/nsBodyFrame.cpp | 8 +- mozilla/layout/html/base/src/nsBodyFrame.h | 5 +- .../layout/html/base/src/nsColumnFrame.cpp | 2 +- .../html/base/src/nsHTMLContainerFrame.cpp | 2 +- .../layout/html/base/src/nsInlineFrame.cpp | 86 ++++++++++--------- mozilla/layout/html/base/src/nsLeafFrame.cpp | 8 +- mozilla/layout/html/base/src/nsLeafFrame.h | 4 +- mozilla/layout/html/base/src/nsLineLayout.cpp | 6 +- .../layout/html/base/src/nsListItemFrame.cpp | 18 ++-- .../layout/html/base/src/nsListItemFrame.h | 2 +- mozilla/layout/html/base/src/nsPageFrame.cpp | 10 +-- mozilla/layout/html/base/src/nsPageFrame.h | 4 +- .../html/base/src/nsPlaceholderFrame.cpp | 2 +- .../layout/html/base/src/nsPlaceholderFrame.h | 2 +- mozilla/layout/html/base/src/nsRootPart.cpp | 28 +++--- mozilla/layout/html/base/src/nsSpacerPart.cpp | 25 +++--- .../layout/html/base/src/nsTextContent.cpp | 46 +++++----- .../layout/html/forms/src/nsInputButton.cpp | 6 +- .../layout/html/forms/src/nsInputFrame.cpp | 8 +- mozilla/layout/html/forms/src/nsInputFrame.h | 2 +- .../html/table/src/nsTableCaptionFrame.cpp | 16 ++-- .../html/table/src/nsTableCaptionFrame.h | 4 +- .../html/table/src/nsTableCellFrame.cpp | 8 +- .../layout/html/table/src/nsTableCellFrame.h | 4 +- mozilla/layout/html/table/src/nsTableCol.cpp | 12 +-- .../html/table/src/nsTableColGroupFrame.cpp | 6 +- .../html/table/src/nsTableColGroupFrame.h | 4 +- .../layout/html/table/src/nsTableFrame.cpp | 74 ++++++++-------- mozilla/layout/html/table/src/nsTableFrame.h | 30 +++---- .../html/table/src/nsTableOuterFrame.cpp | 60 ++++++------- .../layout/html/table/src/nsTableOuterFrame.h | 30 +++---- .../layout/html/table/src/nsTableRowFrame.cpp | 60 ++++++------- .../layout/html/table/src/nsTableRowFrame.h | 10 +-- .../html/table/src/nsTableRowGroupFrame.cpp | 48 +++++------ .../html/table/src/nsTableRowGroupFrame.h | 10 +-- mozilla/layout/html/tests/TestInlineFrame.cpp | 62 ++++++------- mozilla/layout/tables/nsTableCellFrame.cpp | 8 +- mozilla/layout/tables/nsTableCellFrame.h | 4 +- .../layout/tables/nsTableColGroupFrame.cpp | 6 +- mozilla/layout/tables/nsTableColGroupFrame.h | 4 +- mozilla/layout/tables/nsTableFrame.cpp | 74 ++++++++-------- mozilla/layout/tables/nsTableFrame.h | 30 +++---- mozilla/layout/tables/nsTableOuterFrame.cpp | 60 ++++++------- mozilla/layout/tables/nsTableOuterFrame.h | 30 +++---- mozilla/layout/tables/nsTableRowFrame.cpp | 60 ++++++------- mozilla/layout/tables/nsTableRowFrame.h | 10 +-- .../layout/tables/nsTableRowGroupFrame.cpp | 48 +++++------ mozilla/layout/tables/nsTableRowGroupFrame.h | 10 +-- 81 files changed, 937 insertions(+), 891 deletions(-) diff --git a/mozilla/layout/base/public/nsIFrame.h b/mozilla/layout/base/public/nsIFrame.h index b762b19a924..a0eaa35a3e1 100644 --- a/mozilla/layout/base/public/nsIFrame.h +++ b/mozilla/layout/base/public/nsIFrame.h @@ -65,6 +65,34 @@ struct nsReflowMetrics { */ #define NS_UNCONSTRAINEDSIZE NS_MAXSIZE +/** + * Reflow status returned by the reflow methods. + * + * NS_FRAME_COMPLETE bit flag means the frame maps all its content. If this bit + * isn't set it means the frame doesn't map all its content, and that the parent + * frame should create a continuing frame. + * + * NS_FRAME_REFLOW_NEXTINFLOW bit flag means that the next-in-flow is dirty, and + * also needs to be reflowed. This status only makes sense for a frame that is + * not complete, i.e. you wouldn't set both NS_FRAME_COMPLETE and + * NS_FRAME_REFLOW_NEXTINFLOW + * + * @see #ResizeReflow() + * @see #IncrementalReflow() + * @see #CreateContinuingFrame() + */ +typedef PRUint32 nsReflowStatus; + +#define NS_FRAME_COMPLETE 0x01 +#define NS_FRAME_REFLOW_NEXTINFLOW 0x02 + +#define NS_FRAME_IS_COMPLETE(status)\ + (((status) & NS_FRAME_COMPLETE) == NS_FRAME_COMPLETE) +#define NS_FRAME_IS_NOT_COMPLETE(status)\ + (((status) & NS_FRAME_COMPLETE) == 0) + +#define NS_FRAME_NOT_COMPLETE 0 + /** * A frame in the layout model. This interface is supported by all frame * objects. @@ -172,17 +200,6 @@ public: nsIFrame** aFrame, PRInt32& aCursor) = 0; - /** - * Reflow status returned by the reflow methods. frNotComplete means you didn't - * map all your content, and so your parent should create a continuing frame - * for you. - * - * @see #ResizeReflow() - * @see #IncrementalReflow() - * @see #CreateContinuingFrame() - */ - enum ReflowStatus {frComplete, frNotComplete}; - /** * Resize reflow. The frame is given a maximum size and asked for its desired * size. This is the frame's opportunity to reflow its children. @@ -208,7 +225,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) = 0; + nsReflowStatus& aStatus) = 0; /** * Post-processing reflow method invoked when justification is enabled. @@ -246,7 +263,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) = 0; + nsReflowStatus& aStatus) = 0; /** * This call is invoked when content is appended to the content tree. diff --git a/mozilla/layout/base/public/nsIRunaround.h b/mozilla/layout/base/public/nsIRunaround.h index 286339f9199..059b2e7e88b 100644 --- a/mozilla/layout/base/public/nsIRunaround.h +++ b/mozilla/layout/base/public/nsIRunaround.h @@ -65,12 +65,12 @@ public: * * @see nsISpaceManager#Translate() */ - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - nsIFrame::ReflowStatus& aStatus) = 0; + NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus) = 0; /** * Incremental reflow. The reflow command contains information about the @@ -101,12 +101,12 @@ public: * @param aReflowCommand the reflow command contains information about the * type of change. */ - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - nsIFrame::ReflowStatus& aStatus) = 0; + NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsReflowCommand& aReflowCommand, + nsReflowStatus& aStatus) = 0; }; #endif /* nsIRunaround_h___ */ diff --git a/mozilla/layout/base/src/nsContainerFrame.cpp b/mozilla/layout/base/src/nsContainerFrame.cpp index 3deff57e22d..bd07fe3dfd1 100644 --- a/mozilla/layout/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/base/src/nsContainerFrame.cpp @@ -402,7 +402,7 @@ PRBool nsContainerFrame::ChildIsPseudoFrame(const nsIFrame* aChild) const PRBool result; aChild->GetContent(childContent); - result = PRBool(childContent == mContent); + result = childContent == mContent; NS_RELEASE(childContent); return result; } @@ -415,18 +415,17 @@ PRBool nsContainerFrame::ChildIsPseudoFrame(const nsIFrame* aChild) const * child is complete and it has next-in-flows (it was a splittable child) * then delete the next-in-flows. */ -nsIFrame::ReflowStatus -nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) +nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, + nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize) { - ReflowStatus status; + nsReflowStatus status; aKidFrame->ResizeReflow(aPresContext, aDesiredSize, aMaxSize, aMaxElementSize, status); - if (frComplete == status) { + if (NS_FRAME_IS_COMPLETE(status)) { nsIFrame* kidNextInFlow; aKidFrame->GetNextInFlow(kidNextInFlow); @@ -452,16 +451,15 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, * used to reflow the child; otherwise interface nsIFrame is used. If the * child is splittable then runaround is done using continuing frames. */ -nsIFrame::ReflowStatus -nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize) +nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, + nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize) { - nsIRunaround* reflowRunaround; - ReflowStatus status; + nsIRunaround* reflowRunaround; + nsReflowStatus status; // Get the band for this y-offset and see whether there are any floaters // that have changed the left/right edges. @@ -556,7 +554,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, aDesiredRect.height = desiredSize.height; } - if (frComplete == status) { + if (NS_FRAME_IS_COMPLETE(status)) { nsIFrame* kidNextInFlow; aKidFrame->GetNextInFlow(kidNextInFlow); @@ -802,7 +800,7 @@ void nsContainerFrame::PushChildren(nsIFrame* aFromChild, nsIFrame* lastChildNextInFlow; lastChild->GetNextInFlow(lastChildNextInFlow); - nextInFlow->mLastContentIsComplete = PRBool(nsnull == lastChildNextInFlow); + nextInFlow->mLastContentIsComplete = (nsnull == lastChildNextInFlow); } } nextInFlow->mChildCount += numChildren; @@ -994,7 +992,7 @@ void nsContainerFrame::AppendChildren(nsIFrame* aChild, PRBool aSetParent) nsIFrame* nextInFlow; lastChild->GetNextInFlow(nextInFlow); - mLastContentIsComplete = PRBool(nsnull == nextInFlow); + mLastContentIsComplete = (nsnull == nextInFlow); } #ifdef NS_DEBUG @@ -1333,7 +1331,7 @@ void nsContainerFrame::PreReflowCheck() VerifyLastIsComplete(); } -void nsContainerFrame::PostReflowCheck(ReflowStatus aStatus) +void nsContainerFrame::PostReflowCheck(nsReflowStatus aStatus) { PRInt32 len = LengthOf(mFirstChild) ; NS_ASSERTION(len == mChildCount, "bad child count"); diff --git a/mozilla/layout/base/src/nsContainerFrame.h b/mozilla/layout/base/src/nsContainerFrame.h index 93410fa6444..6889f1d8a03 100644 --- a/mozilla/layout/base/src/nsContainerFrame.h +++ b/mozilla/layout/base/src/nsContainerFrame.h @@ -215,11 +215,11 @@ protected: * Reflow a child frame and return the status of the reflow. If the child * is complete and it has next-in-flows, then delete the next-in-flows. */ - ReflowStatus ReflowChild(nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); + nsReflowStatus ReflowChild(nsIFrame* aKidFrame, + nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize); /** * Reflow a child frame and return the status of the reflow. If the child @@ -236,12 +236,12 @@ protected: * * @see nsIRunaround */ - ReflowStatus ReflowChild(nsIFrame* aKidFrame, - nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize); + nsReflowStatus ReflowChild(nsIFrame* aKidFrame, + nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize); /** * Moves any frames on both the prev-in-flow's overflow list and the receiver's @@ -378,7 +378,7 @@ protected: * is frNotComplete then the next-in-flow content offsets are * validated as well */ - void PostReflowCheck(ReflowStatus aStatus); + void PostReflowCheck(nsReflowStatus aStatus); void CheckNextInFlowOffsets(); diff --git a/mozilla/layout/base/src/nsFrame.cpp b/mozilla/layout/base/src/nsFrame.cpp index aefc45bf814..99dda11f244 100644 --- a/mozilla/layout/base/src/nsFrame.cpp +++ b/mozilla/layout/base/src/nsFrame.cpp @@ -932,7 +932,7 @@ NS_METHOD nsFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aDesiredSize.width = 0; aDesiredSize.height = 0; @@ -942,7 +942,7 @@ NS_METHOD nsFrame::ResizeReflow(nsIPresContext* aPresContext, aMaxElementSize->width = 0; aMaxElementSize->height = 0; } - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } @@ -956,7 +956,7 @@ NS_METHOD nsFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_PRECONDITION(aReflowCommand.GetTarget() == this, "bad target"); @@ -972,7 +972,7 @@ NS_METHOD nsFrame::IncrementalReflow(nsIPresContext* aPresContext, aDesiredSize.height = 0; aDesiredSize.ascent = 0; aDesiredSize.descent = 0; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_ERROR_NOT_IMPLEMENTED; } @@ -1330,7 +1330,7 @@ PRBool IsInRange(nsIContent * aStartContent, nsIContent * aContent) { // Start and End Content is the same, so check against the start if (aStartContent == aEndContent) { - return PRBool(aContent == aStartContent); + return aContent == aStartContent; } // Check to see if it is equal to the start or the end diff --git a/mozilla/layout/base/src/nsFrame.h b/mozilla/layout/base/src/nsFrame.h index 3e162f8bc03..eb344bf1954 100644 --- a/mozilla/layout/base/src/nsFrame.h +++ b/mozilla/layout/base/src/nsFrame.h @@ -95,7 +95,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD JustifyReflow(nsIPresContext* aPresContext, nscoord aAvailableSpace); @@ -105,7 +105,8 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); + NS_IMETHOD ContentAppended(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer); diff --git a/mozilla/layout/base/src/nsPresShell.cpp b/mozilla/layout/base/src/nsPresShell.cpp index bbd657a7754..94c9c8cddd5 100644 --- a/mozilla/layout/base/src/nsPresShell.cpp +++ b/mozilla/layout/base/src/nsPresShell.cpp @@ -417,7 +417,7 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight) #ifdef NS_DEBUG mRootFrame->VerifyTree(); #endif - nsIFrame::ReflowStatus status; + nsReflowStatus status; mRootFrame->ResizeReflow(mPresContext, desiredSize, maxSize, nsnull, status); mRootFrame->SizeTo(desiredSize.width, desiredSize.height); diff --git a/mozilla/layout/base/src/nsReflowCommand.cpp b/mozilla/layout/base/src/nsReflowCommand.cpp index fb72f113e4a..e276f0fb61a 100644 --- a/mozilla/layout/base/src/nsReflowCommand.cpp +++ b/mozilla/layout/base/src/nsReflowCommand.cpp @@ -76,19 +76,18 @@ void nsReflowCommand::Dispatch(nsReflowMetrics& aDesiredSize, if (nsnull != root) { mPath.RemoveElementAt(mPath.Count() - 1); - nsIFrame::ReflowStatus status; - + nsReflowStatus status; root->IncrementalReflow(mPresContext, aDesiredSize, aMaxSize, *this, status); } } // Pass the reflow command to the next frame in the hierarchy -nsIFrame::ReflowStatus nsReflowCommand::Next(nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsIFrame*& aNextFrame) +nsReflowStatus nsReflowCommand::Next(nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsIFrame*& aNextFrame) { - PRInt32 count = mPath.Count(); - nsIFrame::ReflowStatus result = nsIFrame::frComplete; + PRInt32 count = mPath.Count(); + nsReflowStatus result = NS_FRAME_COMPLETE; NS_ASSERTION(count > 0, "empty path vector"); if (count > 0) { @@ -107,13 +106,13 @@ nsIFrame::ReflowStatus nsReflowCommand::Next(nsReflowMetrics& aDesiredSize, // Pass the reflow command to the next frame in the hierarchy. Check // whether it wants to use nsIRunaround or nsIFrame -nsIFrame::ReflowStatus nsReflowCommand::Next(nsISpaceManager* aSpaceManager, - nsRect& aDesiredRect, - const nsSize& aMaxSize, - nsIFrame*& aNextFrame) +nsReflowStatus nsReflowCommand::Next(nsISpaceManager* aSpaceManager, + nsRect& aDesiredRect, + const nsSize& aMaxSize, + nsIFrame*& aNextFrame) { - PRInt32 count = mPath.Count(); - nsIFrame::ReflowStatus result = nsIFrame::frComplete; + PRInt32 count = mPath.Count(); + nsReflowStatus result = NS_FRAME_COMPLETE; NS_ASSERTION(count > 0, "empty path vector"); if (count > 0) { diff --git a/mozilla/layout/base/src/nsReflowCommand.h b/mozilla/layout/base/src/nsReflowCommand.h index 472a7c4460d..8db9e7b3c6a 100644 --- a/mozilla/layout/base/src/nsReflowCommand.h +++ b/mozilla/layout/base/src/nsReflowCommand.h @@ -77,9 +77,9 @@ public: // Pass the reflow command to the next frame in the hierarchy. Returns the // status and the next frame to which the command was dispatched - nsIFrame::ReflowStatus Next(nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsIFrame*& aNextFrame); + nsReflowStatus Next(nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsIFrame*& aNextFrame); // Pass the reflow command to the next frame in the hierarchy. Returns the // status and the next frame to which the command was dispatched @@ -87,10 +87,10 @@ public: // Use this version if you have a space manager. This function will check if // the caller supports nsIRunaround and call either the nsIFrame or the // nsIRunaround IncrementalReflow() function - nsIFrame::ReflowStatus Next(nsISpaceManager* aSpaceManager, - nsRect& aDesiredRect, - const nsSize& aMaxSize, - nsIFrame*& aNextFrame); + nsReflowStatus Next(nsISpaceManager* aSpaceManager, + nsRect& aDesiredRect, + const nsSize& aMaxSize, + nsIFrame*& aNextFrame); nsIFrame* GetNext() const; diff --git a/mozilla/layout/base/src/nsSplittableFrame.h b/mozilla/layout/base/src/nsSplittableFrame.h index 34b092c98b4..13cbe0dda3a 100644 --- a/mozilla/layout/base/src/nsSplittableFrame.h +++ b/mozilla/layout/base/src/nsSplittableFrame.h @@ -41,12 +41,12 @@ public: /** * Return the first frame in our current flow. */ - nsIFrame* GetFirstInFlow() const; + nsIFrame* GetFirstInFlow() const; /** * Return the last frame in our current flow. */ - nsIFrame* GetLastInFlow() const; + nsIFrame* GetLastInFlow() const; NS_IMETHOD AppendToFlow(nsIFrame* aAfterFrame); NS_IMETHOD PrependToFlow(nsIFrame* aAfterFrame); @@ -54,8 +54,8 @@ public: NS_IMETHOD BreakFromPrevFlow(); NS_IMETHOD BreakFromNextFlow(); - nsIFrame * GetPrevInFlow(); - nsIFrame * GetNextInFlow(); + nsIFrame* GetPrevInFlow(); + nsIFrame* GetNextInFlow(); protected: diff --git a/mozilla/layout/base/tests/TestContainerFrame.cpp b/mozilla/layout/base/tests/TestContainerFrame.cpp index 32770681856..66dab15c36d 100644 --- a/mozilla/layout/base/tests/TestContainerFrame.cpp +++ b/mozilla/layout/base/tests/TestContainerFrame.cpp @@ -92,10 +92,10 @@ class SimpleContainer : public nsContainerFrame public: SimpleContainer(nsIContent* aContent); - ReflowStatus IncrementalReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsReflowCommand& aReflowCommand); + nsReflowStatus IncrementalReflow(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsReflowCommand& aReflowCommand); void SetFirstChild(nsIFrame* aChild, PRInt32 aChildCount); nsIFrame* GetOverflowList() {return mOverflowList;} @@ -113,14 +113,14 @@ SimpleContainer::SimpleContainer(nsIContent* aContent) { } -nsIFrame::ReflowStatus +nsReflowStatus SimpleContainer::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand) { NS_NOTYETIMPLEMENTED("incremental reflow"); - return frComplete; + return NS_FRAME_COMPLETE; } // Sets mFirstChild and mChildCount, but not mContentOffset, mContentLength, diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index eb17f80b82c..53b27b87eee 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize, aMaxElementSize); @@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, const nsSize& aMaxSize, nsRect& aDesiredRect, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager, aMaxSize, aDesiredRect, aMaxElementSize); @@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state); if (NS_OK == rv) { @@ -1127,7 +1127,7 @@ nsresult nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, const nsSize& aMaxSize, nsRect& aDesiredRect, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, ComputeDesiredRect(aState, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } #ifdef NS_DEBUG // Verify that the line layout code pulled everything up when it // indicates a complete reflow. - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow; while (nsnull != nextBlock) { NS_ASSERTION((nsnull == nextBlock->mLines) && @@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext, //---------------------------------------------------------------------- NS_METHOD -nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, aMaxElementSize, state); @@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState, } NS_METHOD -nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsReflowCommand& aReflowCommand, + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, #endif nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, nsnull, state); @@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, ComputeDesiredRect(state, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } // Now that reflow has finished, remove the cached pointer diff --git a/mozilla/layout/generic/nsBlockFrame.h b/mozilla/layout/generic/nsBlockFrame.h index 104d812aa5b..4fe18537529 100644 --- a/mozilla/layout/generic/nsBlockFrame.h +++ b/mozilla/layout/generic/nsBlockFrame.h @@ -185,18 +185,18 @@ public: NS_IMETHOD VerifyTree() const; // nsIRunaround - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - nsIFrame::ReflowStatus& aStatus); - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - nsIFrame::ReflowStatus& aStatus); + NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus); + NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsReflowCommand& aReflowCommand, + nsReflowStatus& aStatus); // nsIFloaterContainer virtual PRBool AddFloater(nsIPresContext* aPresContext, @@ -212,7 +212,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); nsresult ReflowBlockChild(nsIFrame* aKidFrame, nsIPresContext* aPresContext, @@ -220,7 +220,7 @@ public: const nsSize& aMaxSize, nsRect& aDesiredRect, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); nsLineData* GetFirstLine(); @@ -245,7 +245,7 @@ protected: nsresult DoResizeReflow(nsBlockReflowState& aState, const nsSize& aMaxSize, nsRect& aDesiredRect, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); void ComputeDesiredRect(nsBlockReflowState& aState, const nsSize& aMaxSize, diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index eb17f80b82c..53b27b87eee 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize, aMaxElementSize); @@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, const nsSize& aMaxSize, nsRect& aDesiredRect, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager, aMaxSize, aDesiredRect, aMaxElementSize); @@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state); if (NS_OK == rv) { @@ -1127,7 +1127,7 @@ nsresult nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, const nsSize& aMaxSize, nsRect& aDesiredRect, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, ComputeDesiredRect(aState, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } #ifdef NS_DEBUG // Verify that the line layout code pulled everything up when it // indicates a complete reflow. - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow; while (nsnull != nextBlock) { NS_ASSERTION((nsnull == nextBlock->mLines) && @@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext, //---------------------------------------------------------------------- NS_METHOD -nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, aMaxElementSize, state); @@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState, } NS_METHOD -nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsReflowCommand& aReflowCommand, + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, #endif nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, nsnull, state); @@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, ComputeDesiredRect(state, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } // Now that reflow has finished, remove the cached pointer diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index eb17f80b82c..53b27b87eee 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize, aMaxElementSize); @@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, const nsSize& aMaxSize, nsRect& aDesiredRect, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager, aMaxSize, aDesiredRect, aMaxElementSize); @@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state); if (NS_OK == rv) { @@ -1127,7 +1127,7 @@ nsresult nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, const nsSize& aMaxSize, nsRect& aDesiredRect, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, ComputeDesiredRect(aState, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } #ifdef NS_DEBUG // Verify that the line layout code pulled everything up when it // indicates a complete reflow. - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow; while (nsnull != nextBlock) { NS_ASSERTION((nsnull == nextBlock->mLines) && @@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext, //---------------------------------------------------------------------- NS_METHOD -nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, aMaxElementSize, state); @@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState, } NS_METHOD -nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsReflowCommand& aReflowCommand, + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, #endif nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, nsnull, state); @@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, ComputeDesiredRect(state, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } // Now that reflow has finished, remove the cached pointer diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp index c171c79dced..b2c3593f569 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/generic/nsHTMLContainerFrame.cpp @@ -431,7 +431,7 @@ nsHTMLContainerFrame::IncrementalReflow(nsIPresContext* aPresContext, break; default: // Ignore all other reflow commands - status = frComplete; + status = NS_FRAME_COMPLETE; break; } } else { diff --git a/mozilla/layout/generic/nsIFrame.h b/mozilla/layout/generic/nsIFrame.h index b762b19a924..a0eaa35a3e1 100644 --- a/mozilla/layout/generic/nsIFrame.h +++ b/mozilla/layout/generic/nsIFrame.h @@ -65,6 +65,34 @@ struct nsReflowMetrics { */ #define NS_UNCONSTRAINEDSIZE NS_MAXSIZE +/** + * Reflow status returned by the reflow methods. + * + * NS_FRAME_COMPLETE bit flag means the frame maps all its content. If this bit + * isn't set it means the frame doesn't map all its content, and that the parent + * frame should create a continuing frame. + * + * NS_FRAME_REFLOW_NEXTINFLOW bit flag means that the next-in-flow is dirty, and + * also needs to be reflowed. This status only makes sense for a frame that is + * not complete, i.e. you wouldn't set both NS_FRAME_COMPLETE and + * NS_FRAME_REFLOW_NEXTINFLOW + * + * @see #ResizeReflow() + * @see #IncrementalReflow() + * @see #CreateContinuingFrame() + */ +typedef PRUint32 nsReflowStatus; + +#define NS_FRAME_COMPLETE 0x01 +#define NS_FRAME_REFLOW_NEXTINFLOW 0x02 + +#define NS_FRAME_IS_COMPLETE(status)\ + (((status) & NS_FRAME_COMPLETE) == NS_FRAME_COMPLETE) +#define NS_FRAME_IS_NOT_COMPLETE(status)\ + (((status) & NS_FRAME_COMPLETE) == 0) + +#define NS_FRAME_NOT_COMPLETE 0 + /** * A frame in the layout model. This interface is supported by all frame * objects. @@ -172,17 +200,6 @@ public: nsIFrame** aFrame, PRInt32& aCursor) = 0; - /** - * Reflow status returned by the reflow methods. frNotComplete means you didn't - * map all your content, and so your parent should create a continuing frame - * for you. - * - * @see #ResizeReflow() - * @see #IncrementalReflow() - * @see #CreateContinuingFrame() - */ - enum ReflowStatus {frComplete, frNotComplete}; - /** * Resize reflow. The frame is given a maximum size and asked for its desired * size. This is the frame's opportunity to reflow its children. @@ -208,7 +225,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) = 0; + nsReflowStatus& aStatus) = 0; /** * Post-processing reflow method invoked when justification is enabled. @@ -246,7 +263,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) = 0; + nsReflowStatus& aStatus) = 0; /** * This call is invoked when content is appended to the content tree. diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp index d5af90ea4af..65c7bac7365 100644 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ b/mozilla/layout/generic/nsInlineFrame.cpp @@ -226,7 +226,7 @@ PRBool nsInlineFrame::ReflowMappedChildrenFrom(nsIPresContext* aPresContext, for (nsIFrame* kidFrame = aChildFrame; nsnull != kidFrame; ) { nsReflowMetrics kidSize; - ReflowStatus status; + nsReflowStatus status; // Reflow the child into the available space status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, @@ -256,8 +256,8 @@ PRBool nsInlineFrame::ReflowMappedChildrenFrom(nsIPresContext* aPresContext, prevKidFrame = kidFrame; // Is the child complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No, the child isn't complete nsIFrame* kidNextInFlow; @@ -358,7 +358,7 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext, while (nsnull != nextInFlow) { nsReflowMetrics kidSize; - ReflowStatus status; + nsReflowStatus status; // Get the next child nsIFrame* kidFrame = nextInFlow->mFirstChild; @@ -443,8 +443,8 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext, prevLastContentIsComplete = mLastContentIsComplete; // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No the child isn't complete nsIFrame* kidNextInFlow; @@ -523,18 +523,17 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext, * * @param aPresContext presentation context to use * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued + * @return NS_FRAME_COMPLETE if all content has been mapped and 0 if we + * should be continued */ -nsIFrame::ReflowStatus -nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, - nsInlineState& aState) +nsReflowStatus nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, + nsInlineState& aState) { #ifdef NS_DEBUG VerifyLastIsComplete(); #endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; + nsIFrame* kidPrevInFlow = nsnull; + nsReflowStatus result = 0; // If we have no children and we have a prev-in-flow then we need to pick // up where it left off. If we have children, e.g. we're being resized, then @@ -563,13 +562,13 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); if (nsnull == kid) { - result = frComplete; + result = NS_FRAME_COMPLETE; break; } // Make sure we still have room left if (aState.availSize.width <= 0) { - // Note: return status was set to frNotComplete above... + // Note: return status was set to 0 above... break; } @@ -629,8 +628,8 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Try to reflow the child into the available space. It might not // fit or might need continuing. nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, - aState.availSize, pKidMaxElementSize); + nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, + aState.availSize, pKidMaxElementSize); // Did the child fit? if ((kidSize.width > aState.availSize.width) && (nsnull != mFirstChild)) { @@ -658,7 +657,7 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, kidIndex++; // Did the child complete? - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // If the child isn't complete then it means that we've used up // all of our available space mLastContentIsComplete = PR_FALSE; @@ -704,7 +703,7 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG PreReflowCheck(); @@ -713,7 +712,7 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; // initialize out parameter + aStatus = NS_FRAME_COMPLETE; // initialize out parameter // Get the style molecule nsStyleFont* styleFont = (nsStyleFont*) @@ -735,7 +734,8 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, reflowMappedOK = ReflowMappedChildrenFrom(aPresContext, state, mFirstChild, 0); if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; + // We didn't successfully reflow our mapped frames; therefore, we're not complete + aStatus = NS_FRAME_NOT_COMPLETE; } } @@ -745,7 +745,8 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, if (state.availSize.width <= 0) { // No space left. Don't try to pull-up children or reflow unmapped if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; + // No room left to map the remaining content; therefore, we're not complete + aStatus = NS_FRAME_NOT_COMPLETE; } } else if (NextChildOffset() < mContent->ChildCount()) { // Try and pull-up some children from a next-in-flow @@ -755,8 +756,9 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, aStatus = ReflowUnmappedChildren(aPresContext, state); } } else { - // We were unable to pull-up all the existing frames from the next in flow - aStatus = frNotComplete; + // We were unable to pull-up all the existing frames from the next in flow; + // therefore, we're not complete + aStatus = NS_FRAME_NOT_COMPLETE; } } } @@ -887,13 +889,13 @@ PRInt32 nsInlineFrame::RecoverState(nsIPresContext* aPresContext, // XXX We need to return information about whether our next-in-flow is // dirty... -nsIFrame::ReflowStatus +nsReflowStatus nsInlineFrame::IncrementalReflowFrom(nsIPresContext* aPresContext, nsInlineState& aState, nsIFrame* aChildFrame, PRInt32 aChildIndex) { - ReflowStatus status = frComplete; + nsReflowStatus status = NS_FRAME_COMPLETE; // Just reflow all the mapped children starting with childFrame. // XXX This isn't the optimal thing to do... @@ -902,32 +904,32 @@ nsInlineFrame::IncrementalReflowFrom(nsIPresContext* aPresContext, // Any space left? if (aState.availSize.width <= 0) { // No space left. Don't try to pull-up children - status = frNotComplete; + status = 0; } else { // Try and pull-up some children from a next-in-flow if (!PullUpChildren(aPresContext, aState)) { // We were not able to pull-up all the child frames from our // next-in-flow - status = frNotComplete; + status = 0; } } } } else { // We were unable to reflow all our mapped frames - status = frNotComplete; + status = 0; } return status; } -nsIFrame::ReflowStatus +nsReflowStatus nsInlineFrame::IncrementalReflowAfter(nsIPresContext* aPresContext, nsInlineState& aState, nsIFrame* aChildFrame, PRInt32 aChildIndex) { - ReflowStatus status = frComplete; - nsIFrame* nextFrame; + nsReflowStatus status = NS_FRAME_COMPLETE; + nsIFrame* nextFrame; aChildFrame->GetNextSibling(nextFrame); @@ -939,19 +941,19 @@ nsInlineFrame::IncrementalReflowAfter(nsIPresContext* aPresContext, // Any space left? if (aState.availSize.width <= 0) { // No space left. Don't try to pull-up children - status = frNotComplete; + status = 0; } else { // Try and pull-up some children from a next-in-flow if (!PullUpChildren(aPresContext, aState)) { // We were not able to pull-up all the child frames from our // next-in-flow - status = frNotComplete; + status = 0; } } } } else { // We were unable to reflow all our mapped frames - status = frNotComplete; + status = 0; } return status; @@ -961,9 +963,9 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { - aStatus = frComplete; // initialize out parameter + aStatus = NS_FRAME_COMPLETE; // initialize out parameter // Get the style molecule nsStyleFont* styleFont = @@ -1036,7 +1038,7 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext, PushChildren(kidFrame, prevFrame, mLastContentIsComplete); SetLastContentOffset(prevFrame); mChildCount = kidIndex - 1; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } else { // Place and size the child @@ -1046,7 +1048,7 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext, kidFrame->GetNextInFlow(kidNextInFlow); // Is the child complete? - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { // Check whether the frame has next-in-flow(s) that are no longer needed if (nsnull != kidNextInFlow) { // Remove the next-in-flow(s) @@ -1117,7 +1119,8 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext, * If one of our children spills over the end then push it to the * next-in-flow or to our overflow list. */ -nsIFrame::ReflowStatus +#if 0 +nsReflowStatus nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, nsInlineState& aState, @@ -1154,5 +1157,6 @@ nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext, // XXX adjust mLastContentOffset if we push // XXX if we push, generate a reflow command - return frComplete; + return NS_FRAME_COMPLETE; } +#endif diff --git a/mozilla/layout/generic/nsLeafFrame.cpp b/mozilla/layout/generic/nsLeafFrame.cpp index 0bb58b88b45..0293de51c0c 100644 --- a/mozilla/layout/generic/nsLeafFrame.cpp +++ b/mozilla/layout/generic/nsLeafFrame.cpp @@ -52,7 +52,7 @@ NS_METHOD nsLeafFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // XXX add in code to check for width/height being set via css // and if set use them instead of calling GetDesiredSize. @@ -63,7 +63,7 @@ NS_METHOD nsLeafFrame::ResizeReflow(nsIPresContext* aPresContext, aMaxElementSize->width = aDesiredSize.width; aMaxElementSize->height = aDesiredSize.height; } - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } @@ -71,7 +71,7 @@ NS_METHOD nsLeafFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // XXX Unless the reflow command is a style change, we should // just return the current size, otherwise we should invoke @@ -82,7 +82,7 @@ NS_METHOD nsLeafFrame::IncrementalReflow(nsIPresContext* aPresContext, GetDesiredSize(aPresContext, aDesiredSize, aMaxSize); AddBordersAndPadding(aPresContext, aDesiredSize); - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/generic/nsLeafFrame.h b/mozilla/layout/generic/nsLeafFrame.h index 0c10771db8b..ff10df3f409 100644 --- a/mozilla/layout/generic/nsLeafFrame.h +++ b/mozilla/layout/generic/nsLeafFrame.h @@ -36,13 +36,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, nsIFrame* aParent, diff --git a/mozilla/layout/generic/nsLineLayout.cpp b/mozilla/layout/generic/nsLineLayout.cpp index 923060e09f1..385ac1a1190 100644 --- a/mozilla/layout/generic/nsLineLayout.cpp +++ b/mozilla/layout/generic/nsLineLayout.cpp @@ -342,7 +342,7 @@ nsLineLayout::WordBreakReflow() mReflowResult = NS_LINE_LAYOUT_REFLOW_RESULT_NOT_AWARE; nsSize maxElementSize; nsReflowMetrics kidSize; - nsIFrame::ReflowStatus kidReflowStatus; + nsReflowStatus kidReflowStatus; nsSize* kidMaxElementSize = nsnull; if (nsnull != mMaxElementSizePointer) { kidMaxElementSize = &maxElementSize; @@ -408,7 +408,7 @@ nsLineLayout::ReflowChild(nsReflowCommand* aReflowCommand) nsSize maxElementSize; nsReflowMetrics kidSize; nsSize* kidMaxElementSize = nsnull; - nsIFrame::ReflowStatus kidReflowStatus; + nsReflowStatus kidReflowStatus; if (nsnull != mMaxElementSizePointer) { kidMaxElementSize = &maxElementSize; } @@ -515,7 +515,7 @@ nsLineLayout::ReflowChild(nsReflowCommand* aReflowCommand) // Set completion status mLine->mLastContentOffset = mKidIndex; - if (nsIFrame::frComplete == kidReflowStatus) { + if (NS_FRAME_IS_COMPLETE(kidReflowStatus)) { mLine->mLastContentIsComplete = PR_TRUE; if (isBlock || (NS_LINE_LAYOUT_REFLOW_RESULT_BREAK_AFTER == mReflowResult)) { diff --git a/mozilla/layout/generic/nsPageFrame.cpp b/mozilla/layout/generic/nsPageFrame.cpp index a15fda7e470..648930b31e7 100644 --- a/mozilla/layout/generic/nsPageFrame.cpp +++ b/mozilla/layout/generic/nsPageFrame.cpp @@ -58,12 +58,12 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG PreReflowCheck(); #endif - aStatus = frComplete; // initialize out parameter + aStatus = NS_FRAME_COMPLETE; // initialize out parameter // Do we have any children? if (nsnull == mFirstChild) { @@ -95,7 +95,7 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext, // Get the child's desired size aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, aMaxSize, aMaxElementSize); - mLastContentIsComplete = PRBool(aStatus == frComplete); + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(aStatus); // Make sure the child is at least as tall as our max size (the containing window) if (aDesiredSize.height < aMaxSize.height) { @@ -107,7 +107,7 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext, mFirstChild->SetRect(rect); // Is the frame complete? - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsIFrame* childNextInFlow; mFirstChild->GetNextInFlow(childNextInFlow); @@ -130,7 +130,7 @@ NS_METHOD PageFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // We don't expect the target of the reflow command to be page frame NS_ASSERTION(aReflowCommand.GetTarget() != this, "page frame is reflow command target"); diff --git a/mozilla/layout/generic/nsPageFrame.h b/mozilla/layout/generic/nsPageFrame.h index 28972f714fa..11230aafbea 100644 --- a/mozilla/layout/generic/nsPageFrame.h +++ b/mozilla/layout/generic/nsPageFrame.h @@ -29,13 +29,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD CreateContinuingFrame(nsIPresContext* aCX, nsIFrame* aParent, diff --git a/mozilla/layout/generic/nsPlaceholderFrame.cpp b/mozilla/layout/generic/nsPlaceholderFrame.cpp index e068ae9ad4c..9a73e7487c1 100644 --- a/mozilla/layout/generic/nsPlaceholderFrame.cpp +++ b/mozilla/layout/generic/nsPlaceholderFrame.cpp @@ -53,7 +53,7 @@ NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // Get the floater container in which we're inserted nsIFloaterContainer* container = nsnull; diff --git a/mozilla/layout/generic/nsPlaceholderFrame.h b/mozilla/layout/generic/nsPlaceholderFrame.h index 036f98eebec..ad50593eca8 100644 --- a/mozilla/layout/generic/nsPlaceholderFrame.h +++ b/mozilla/layout/generic/nsPlaceholderFrame.h @@ -46,7 +46,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; NS_IMETHOD ListTag(FILE* out = stdout) const; diff --git a/mozilla/layout/html/base/src/deadnsInlineFrame.h b/mozilla/layout/html/base/src/deadnsInlineFrame.h index 683358e8208..1f0b319cc92 100644 --- a/mozilla/layout/html/base/src/deadnsInlineFrame.h +++ b/mozilla/layout/html/base/src/deadnsInlineFrame.h @@ -34,13 +34,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext, nsReflowMetrics& aMetrics); @@ -67,8 +67,8 @@ protected: PRBool PullUpChildren(nsIPresContext* aPresContext, nsInlineState& aState); - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - nsInlineState& aState); + nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, + nsInlineState& aState); void PlaceChild(nsIFrame* aChild, PRInt32 aIndex, // in the child frame list @@ -80,22 +80,24 @@ protected: nsInlineState& aState, nsIFrame* aSkipChild); - ReflowStatus IncrementalReflowFrom(nsIPresContext* aPresContext, - nsInlineState& aState, - nsIFrame* aChildFrame, - PRInt32 aChildIndex); + nsReflowStatus IncrementalReflowFrom(nsIPresContext* aPresContext, + nsInlineState& aState, + nsIFrame* aChildFrame, + PRInt32 aChildIndex); - ReflowStatus IncrementalReflowAfter(nsIPresContext* aPresContext, - nsInlineState& aState, - nsIFrame* aChildFrame, - PRInt32 aChildIndex); + nsReflowStatus IncrementalReflowAfter(nsIPresContext* aPresContext, + nsInlineState& aState, + nsIFrame* aChildFrame, + PRInt32 aChildIndex); - ReflowStatus AdjustChildren(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - nsInlineState& aState, - nsIFrame* aKid, - nsReflowMetrics& aKidMetrics, - ReflowStatus aKidReflowStatus); +#if 0 + nsReflowStatus AdjustChildren(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + nsInlineState& aState, + nsIFrame* aKid, + nsReflowMetrics& aKidMetrics, + ReflowStatus aKidReflowStatus); +#endif }; #endif /* nsInlineFrame_h___ */ diff --git a/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp b/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp index 3bbae4c24e5..56aac626417 100644 --- a/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp +++ b/mozilla/layout/html/base/src/nsAbsoluteFrame.cpp @@ -228,7 +228,7 @@ NS_METHOD AbsoluteFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // Have we created the absolutely positioned item yet? if (nsnull == mFrame) { diff --git a/mozilla/layout/html/base/src/nsAbsoluteFrame.h b/mozilla/layout/html/base/src/nsAbsoluteFrame.h index 9214a8ee130..c7616e0dcc9 100644 --- a/mozilla/layout/html/base/src/nsAbsoluteFrame.h +++ b/mozilla/layout/html/base/src/nsAbsoluteFrame.h @@ -44,7 +44,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; protected: diff --git a/mozilla/layout/html/base/src/nsBRPart.cpp b/mozilla/layout/html/base/src/nsBRPart.cpp index 3918ac40e4d..710132afd47 100644 --- a/mozilla/layout/html/base/src/nsBRPart.cpp +++ b/mozilla/layout/html/base/src/nsBRPart.cpp @@ -45,7 +45,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext, nsReflowMetrics& aMetrics); @@ -102,7 +102,7 @@ NS_METHOD BRFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // Get cached state for containing block frame nsLineLayout* lineLayoutState = nsnull; @@ -117,7 +117,7 @@ NS_METHOD BRFrame::ResizeReflow(nsIPresContext* aPresContext, } GetReflowMetrics(aPresContext, aDesiredSize); - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index eb17f80b82c..53b27b87eee 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize, aMaxElementSize); @@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, const nsSize& aMaxSize, nsRect& aDesiredRect, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager, aMaxSize, aDesiredRect, aMaxElementSize); @@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state); if (NS_OK == rv) { @@ -1127,7 +1127,7 @@ nsresult nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, const nsSize& aMaxSize, nsRect& aDesiredRect, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, ComputeDesiredRect(aState, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } #ifdef NS_DEBUG // Verify that the line layout code pulled everything up when it // indicates a complete reflow. - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow; while (nsnull != nextBlock) { NS_ASSERTION((nsnull == nextBlock->mLines) && @@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext, //---------------------------------------------------------------------- NS_METHOD -nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, aMaxElementSize, state); @@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState, } NS_METHOD -nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsReflowCommand& aReflowCommand, + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, #endif nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, nsnull, state); @@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, ComputeDesiredRect(state, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } // Now that reflow has finished, remove the cached pointer diff --git a/mozilla/layout/html/base/src/nsBlockFrame.h b/mozilla/layout/html/base/src/nsBlockFrame.h index 104d812aa5b..4fe18537529 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.h +++ b/mozilla/layout/html/base/src/nsBlockFrame.h @@ -185,18 +185,18 @@ public: NS_IMETHOD VerifyTree() const; // nsIRunaround - NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - nsIFrame::ReflowStatus& aStatus); - NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - nsIFrame::ReflowStatus& aStatus); + NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus); + NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsReflowCommand& aReflowCommand, + nsReflowStatus& aStatus); // nsIFloaterContainer virtual PRBool AddFloater(nsIPresContext* aPresContext, @@ -212,7 +212,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); nsresult ReflowBlockChild(nsIFrame* aKidFrame, nsIPresContext* aPresContext, @@ -220,7 +220,7 @@ public: const nsSize& aMaxSize, nsRect& aDesiredRect, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); nsLineData* GetFirstLine(); @@ -245,7 +245,7 @@ protected: nsresult DoResizeReflow(nsBlockReflowState& aState, const nsSize& aMaxSize, nsRect& aDesiredRect, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); void ComputeDesiredRect(nsBlockReflowState& aState, const nsSize& aMaxSize, diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index eb17f80b82c..53b27b87eee 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize, aMaxElementSize); @@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, const nsSize& aMaxSize, nsRect& aDesiredRect, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager, aMaxSize, aDesiredRect, aMaxElementSize); @@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state); if (NS_OK == rv) { @@ -1127,7 +1127,7 @@ nsresult nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, const nsSize& aMaxSize, nsRect& aDesiredRect, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, ComputeDesiredRect(aState, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } #ifdef NS_DEBUG // Verify that the line layout code pulled everything up when it // indicates a complete reflow. - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow; while (nsnull != nextBlock) { NS_ASSERTION((nsnull == nextBlock->mLines) && @@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext, //---------------------------------------------------------------------- NS_METHOD -nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, aMaxElementSize, state); @@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState, } NS_METHOD -nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsReflowCommand& aReflowCommand, + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, #endif nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, nsnull, state); @@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, ComputeDesiredRect(state, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } // Now that reflow has finished, remove the cached pointer diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index eb17f80b82c..53b27b87eee 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize, aMaxElementSize); @@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, const nsSize& aMaxSize, nsRect& aDesiredRect, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager, aMaxSize, aDesiredRect, aMaxElementSize); @@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state); if (NS_OK == rv) { @@ -1127,7 +1127,7 @@ nsresult nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, const nsSize& aMaxSize, nsRect& aDesiredRect, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState, ComputeDesiredRect(aState, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } #ifdef NS_DEBUG // Verify that the line layout code pulled everything up when it // indicates a complete reflow. - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow; while (nsnull != nextBlock) { NS_ASSERTION((nsnull == nextBlock->mLines) && @@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext, //---------------------------------------------------------------------- NS_METHOD -nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsSize* aMaxElementSize, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus) { nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, aMaxElementSize, state); @@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState, } NS_METHOD -nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, - nsISpaceManager* aSpaceManager, - const nsSize& aMaxSize, - nsRect& aDesiredRect, - nsReflowCommand& aReflowCommand, - nsIFrame::ReflowStatus& aStatus) +nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, + nsISpaceManager* aSpaceManager, + const nsSize& aMaxSize, + nsRect& aDesiredRect, + nsReflowCommand& aReflowCommand, + nsReflowStatus& aStatus) { #ifdef NS_DEBUG VerifyLines(PR_TRUE); @@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, #endif nsresult rv = NS_OK; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsBlockReflowState state; rv = InitializeState(aPresContext, aSpaceManager, aMaxSize, nsnull, state); @@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext, ComputeDesiredRect(state, aMaxSize, aDesiredRect); // Set return status - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) { rv = NS_OK; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } // Now that reflow has finished, remove the cached pointer diff --git a/mozilla/layout/html/base/src/nsBodyFrame.cpp b/mozilla/layout/html/base/src/nsBodyFrame.cpp index 4346cf97872..6fee388ea57 100644 --- a/mozilla/layout/html/base/src/nsBodyFrame.cpp +++ b/mozilla/layout/html/base/src/nsBodyFrame.cpp @@ -134,9 +134,9 @@ NS_METHOD nsBodyFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { - aStatus = frComplete; // initialize out parameter + aStatus = NS_FRAME_COMPLETE; // initialize out parameter // Do we have any children? if (nsnull == mFirstChild) { @@ -177,7 +177,7 @@ NS_METHOD nsBodyFrame::ResizeReflow(nsIPresContext* aPresContext, // If the frame is complete, then check whether there's a next-in-flow that // needs to be deleted - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsIFrame* kidNextInFlow; mFirstChild->GetNextInFlow(kidNextInFlow); @@ -249,7 +249,7 @@ NS_METHOD nsBodyFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // XXX Currently there's a bug that when the body background image dimension // is resolved we're treating that as a content change rather than just repainting diff --git a/mozilla/layout/html/base/src/nsBodyFrame.h b/mozilla/layout/html/base/src/nsBodyFrame.h index 634a82fe7b0..e18da1bf079 100644 --- a/mozilla/layout/html/base/src/nsBodyFrame.h +++ b/mozilla/layout/html/base/src/nsBodyFrame.h @@ -37,13 +37,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD ContentAppended(nsIPresShell* aShell, nsIPresContext* aPresContext, @@ -60,6 +60,7 @@ public: nsIStyleContext* aStyleContext, nsIFrame*& aContinuingFrame); + // nsIAnchoredItems virtual void AddAnchoredItem(nsIFrame* aAnchoredItem, AnchoringPosition aPosition, nsIFrame* aContainer); diff --git a/mozilla/layout/html/base/src/nsColumnFrame.cpp b/mozilla/layout/html/base/src/nsColumnFrame.cpp index 6bb458e26ce..299726eb526 100644 --- a/mozilla/layout/html/base/src/nsColumnFrame.cpp +++ b/mozilla/layout/html/base/src/nsColumnFrame.cpp @@ -311,7 +311,7 @@ PRBool ColumnFrame::ReflowMappedChildren(nsIPresContext* aPresContext, childCount++; // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); // Special handling for incomplete children if (frNotComplete == status) { diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp index c171c79dced..b2c3593f569 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -431,7 +431,7 @@ nsHTMLContainerFrame::IncrementalReflow(nsIPresContext* aPresContext, break; default: // Ignore all other reflow commands - status = frComplete; + status = NS_FRAME_COMPLETE; break; } } else { diff --git a/mozilla/layout/html/base/src/nsInlineFrame.cpp b/mozilla/layout/html/base/src/nsInlineFrame.cpp index d5af90ea4af..65c7bac7365 100644 --- a/mozilla/layout/html/base/src/nsInlineFrame.cpp +++ b/mozilla/layout/html/base/src/nsInlineFrame.cpp @@ -226,7 +226,7 @@ PRBool nsInlineFrame::ReflowMappedChildrenFrom(nsIPresContext* aPresContext, for (nsIFrame* kidFrame = aChildFrame; nsnull != kidFrame; ) { nsReflowMetrics kidSize; - ReflowStatus status; + nsReflowStatus status; // Reflow the child into the available space status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize, @@ -256,8 +256,8 @@ PRBool nsInlineFrame::ReflowMappedChildrenFrom(nsIPresContext* aPresContext, prevKidFrame = kidFrame; // Is the child complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No, the child isn't complete nsIFrame* kidNextInFlow; @@ -358,7 +358,7 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext, while (nsnull != nextInFlow) { nsReflowMetrics kidSize; - ReflowStatus status; + nsReflowStatus status; // Get the next child nsIFrame* kidFrame = nextInFlow->mFirstChild; @@ -443,8 +443,8 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext, prevLastContentIsComplete = mLastContentIsComplete; // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No the child isn't complete nsIFrame* kidNextInFlow; @@ -523,18 +523,17 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext, * * @param aPresContext presentation context to use * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete - * if we should be continued + * @return NS_FRAME_COMPLETE if all content has been mapped and 0 if we + * should be continued */ -nsIFrame::ReflowStatus -nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, - nsInlineState& aState) +nsReflowStatus nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, + nsInlineState& aState) { #ifdef NS_DEBUG VerifyLastIsComplete(); #endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; + nsIFrame* kidPrevInFlow = nsnull; + nsReflowStatus result = 0; // If we have no children and we have a prev-in-flow then we need to pick // up where it left off. If we have children, e.g. we're being resized, then @@ -563,13 +562,13 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); if (nsnull == kid) { - result = frComplete; + result = NS_FRAME_COMPLETE; break; } // Make sure we still have room left if (aState.availSize.width <= 0) { - // Note: return status was set to frNotComplete above... + // Note: return status was set to 0 above... break; } @@ -629,8 +628,8 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Try to reflow the child into the available space. It might not // fit or might need continuing. nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, - aState.availSize, pKidMaxElementSize); + nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, + aState.availSize, pKidMaxElementSize); // Did the child fit? if ((kidSize.width > aState.availSize.width) && (nsnull != mFirstChild)) { @@ -658,7 +657,7 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, kidIndex++; // Did the child complete? - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // If the child isn't complete then it means that we've used up // all of our available space mLastContentIsComplete = PR_FALSE; @@ -704,7 +703,7 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG PreReflowCheck(); @@ -713,7 +712,7 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; // initialize out parameter + aStatus = NS_FRAME_COMPLETE; // initialize out parameter // Get the style molecule nsStyleFont* styleFont = (nsStyleFont*) @@ -735,7 +734,8 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, reflowMappedOK = ReflowMappedChildrenFrom(aPresContext, state, mFirstChild, 0); if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; + // We didn't successfully reflow our mapped frames; therefore, we're not complete + aStatus = NS_FRAME_NOT_COMPLETE; } } @@ -745,7 +745,8 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, if (state.availSize.width <= 0) { // No space left. Don't try to pull-up children or reflow unmapped if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; + // No room left to map the remaining content; therefore, we're not complete + aStatus = NS_FRAME_NOT_COMPLETE; } } else if (NextChildOffset() < mContent->ChildCount()) { // Try and pull-up some children from a next-in-flow @@ -755,8 +756,9 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext, aStatus = ReflowUnmappedChildren(aPresContext, state); } } else { - // We were unable to pull-up all the existing frames from the next in flow - aStatus = frNotComplete; + // We were unable to pull-up all the existing frames from the next in flow; + // therefore, we're not complete + aStatus = NS_FRAME_NOT_COMPLETE; } } } @@ -887,13 +889,13 @@ PRInt32 nsInlineFrame::RecoverState(nsIPresContext* aPresContext, // XXX We need to return information about whether our next-in-flow is // dirty... -nsIFrame::ReflowStatus +nsReflowStatus nsInlineFrame::IncrementalReflowFrom(nsIPresContext* aPresContext, nsInlineState& aState, nsIFrame* aChildFrame, PRInt32 aChildIndex) { - ReflowStatus status = frComplete; + nsReflowStatus status = NS_FRAME_COMPLETE; // Just reflow all the mapped children starting with childFrame. // XXX This isn't the optimal thing to do... @@ -902,32 +904,32 @@ nsInlineFrame::IncrementalReflowFrom(nsIPresContext* aPresContext, // Any space left? if (aState.availSize.width <= 0) { // No space left. Don't try to pull-up children - status = frNotComplete; + status = 0; } else { // Try and pull-up some children from a next-in-flow if (!PullUpChildren(aPresContext, aState)) { // We were not able to pull-up all the child frames from our // next-in-flow - status = frNotComplete; + status = 0; } } } } else { // We were unable to reflow all our mapped frames - status = frNotComplete; + status = 0; } return status; } -nsIFrame::ReflowStatus +nsReflowStatus nsInlineFrame::IncrementalReflowAfter(nsIPresContext* aPresContext, nsInlineState& aState, nsIFrame* aChildFrame, PRInt32 aChildIndex) { - ReflowStatus status = frComplete; - nsIFrame* nextFrame; + nsReflowStatus status = NS_FRAME_COMPLETE; + nsIFrame* nextFrame; aChildFrame->GetNextSibling(nextFrame); @@ -939,19 +941,19 @@ nsInlineFrame::IncrementalReflowAfter(nsIPresContext* aPresContext, // Any space left? if (aState.availSize.width <= 0) { // No space left. Don't try to pull-up children - status = frNotComplete; + status = 0; } else { // Try and pull-up some children from a next-in-flow if (!PullUpChildren(aPresContext, aState)) { // We were not able to pull-up all the child frames from our // next-in-flow - status = frNotComplete; + status = 0; } } } } else { // We were unable to reflow all our mapped frames - status = frNotComplete; + status = 0; } return status; @@ -961,9 +963,9 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { - aStatus = frComplete; // initialize out parameter + aStatus = NS_FRAME_COMPLETE; // initialize out parameter // Get the style molecule nsStyleFont* styleFont = @@ -1036,7 +1038,7 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext, PushChildren(kidFrame, prevFrame, mLastContentIsComplete); SetLastContentOffset(prevFrame); mChildCount = kidIndex - 1; - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } else { // Place and size the child @@ -1046,7 +1048,7 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext, kidFrame->GetNextInFlow(kidNextInFlow); // Is the child complete? - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { // Check whether the frame has next-in-flow(s) that are no longer needed if (nsnull != kidNextInFlow) { // Remove the next-in-flow(s) @@ -1117,7 +1119,8 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext, * If one of our children spills over the end then push it to the * next-in-flow or to our overflow list. */ -nsIFrame::ReflowStatus +#if 0 +nsReflowStatus nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, nsInlineState& aState, @@ -1154,5 +1157,6 @@ nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext, // XXX adjust mLastContentOffset if we push // XXX if we push, generate a reflow command - return frComplete; + return NS_FRAME_COMPLETE; } +#endif diff --git a/mozilla/layout/html/base/src/nsLeafFrame.cpp b/mozilla/layout/html/base/src/nsLeafFrame.cpp index 0bb58b88b45..0293de51c0c 100644 --- a/mozilla/layout/html/base/src/nsLeafFrame.cpp +++ b/mozilla/layout/html/base/src/nsLeafFrame.cpp @@ -52,7 +52,7 @@ NS_METHOD nsLeafFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // XXX add in code to check for width/height being set via css // and if set use them instead of calling GetDesiredSize. @@ -63,7 +63,7 @@ NS_METHOD nsLeafFrame::ResizeReflow(nsIPresContext* aPresContext, aMaxElementSize->width = aDesiredSize.width; aMaxElementSize->height = aDesiredSize.height; } - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } @@ -71,7 +71,7 @@ NS_METHOD nsLeafFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // XXX Unless the reflow command is a style change, we should // just return the current size, otherwise we should invoke @@ -82,7 +82,7 @@ NS_METHOD nsLeafFrame::IncrementalReflow(nsIPresContext* aPresContext, GetDesiredSize(aPresContext, aDesiredSize, aMaxSize); AddBordersAndPadding(aPresContext, aDesiredSize); - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/html/base/src/nsLeafFrame.h b/mozilla/layout/html/base/src/nsLeafFrame.h index 0c10771db8b..ff10df3f409 100644 --- a/mozilla/layout/html/base/src/nsLeafFrame.h +++ b/mozilla/layout/html/base/src/nsLeafFrame.h @@ -36,13 +36,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, nsIFrame* aParent, diff --git a/mozilla/layout/html/base/src/nsLineLayout.cpp b/mozilla/layout/html/base/src/nsLineLayout.cpp index 923060e09f1..385ac1a1190 100644 --- a/mozilla/layout/html/base/src/nsLineLayout.cpp +++ b/mozilla/layout/html/base/src/nsLineLayout.cpp @@ -342,7 +342,7 @@ nsLineLayout::WordBreakReflow() mReflowResult = NS_LINE_LAYOUT_REFLOW_RESULT_NOT_AWARE; nsSize maxElementSize; nsReflowMetrics kidSize; - nsIFrame::ReflowStatus kidReflowStatus; + nsReflowStatus kidReflowStatus; nsSize* kidMaxElementSize = nsnull; if (nsnull != mMaxElementSizePointer) { kidMaxElementSize = &maxElementSize; @@ -408,7 +408,7 @@ nsLineLayout::ReflowChild(nsReflowCommand* aReflowCommand) nsSize maxElementSize; nsReflowMetrics kidSize; nsSize* kidMaxElementSize = nsnull; - nsIFrame::ReflowStatus kidReflowStatus; + nsReflowStatus kidReflowStatus; if (nsnull != mMaxElementSizePointer) { kidMaxElementSize = &maxElementSize; } @@ -515,7 +515,7 @@ nsLineLayout::ReflowChild(nsReflowCommand* aReflowCommand) // Set completion status mLine->mLastContentOffset = mKidIndex; - if (nsIFrame::frComplete == kidReflowStatus) { + if (NS_FRAME_IS_COMPLETE(kidReflowStatus)) { mLine->mLastContentIsComplete = PR_TRUE; if (isBlock || (NS_LINE_LAYOUT_REFLOW_RESULT_BREAK_AFTER == mReflowResult)) { diff --git a/mozilla/layout/html/base/src/nsListItemFrame.cpp b/mozilla/layout/html/base/src/nsListItemFrame.cpp index 5d984e0503d..f06b5bb13d3 100644 --- a/mozilla/layout/html/base/src/nsListItemFrame.cpp +++ b/mozilla/layout/html/base/src/nsListItemFrame.cpp @@ -60,13 +60,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aCX, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); void GetBulletSize(nsIPresContext* aCX, nsReflowMetrics& aDesiredSize, @@ -140,7 +140,7 @@ NS_METHOD BulletFrame::ResizeReflow(nsIPresContext* aCX, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { GetBulletSize(aCX, aDesiredSize, aMaxSize); if (nsnull != aMaxElementSize) { @@ -153,7 +153,7 @@ NS_METHOD BulletFrame::ResizeReflow(nsIPresContext* aCX, // the bullet must be mapping the second content object instead of // mapping the first content object. mLastContentIsComplete = PR_FALSE; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } @@ -161,14 +161,14 @@ NS_METHOD BulletFrame::IncrementalReflow(nsIPresContext* aCX, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // XXX Unless the reflow command is a style change, we should // just return the current size, otherwise we should invoke // GetBulletSize GetBulletSize(aCX, aDesiredSize, aMaxSize); - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } @@ -574,7 +574,7 @@ NS_METHOD nsListItemFrame::ResizeReflow(nsIPresContext* aCX, const nsSize& aMaxSize, nsRect& aDesiredRect, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { PRBool insideBullet = PR_FALSE; @@ -639,9 +639,9 @@ NS_METHOD nsListItemFrame::IncrementalReflow(nsIPresContext* aCX, const nsSize& aMaxSize, nsRect& aDesiredRect, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; // XXX return NS_OK; } diff --git a/mozilla/layout/html/base/src/nsListItemFrame.h b/mozilla/layout/html/base/src/nsListItemFrame.h index b1dcbf6fa03..dd58c75b34e 100644 --- a/mozilla/layout/html/base/src/nsListItemFrame.h +++ b/mozilla/layout/html/base/src/nsListItemFrame.h @@ -33,7 +33,7 @@ public: const nsSize& aMaxSize, nsRect& aDesiredRect, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD CreateContinuingFrame(nsIPresContext* aCX, nsIFrame* aParent, nsIStyleContext* aStyleContext, diff --git a/mozilla/layout/html/base/src/nsPageFrame.cpp b/mozilla/layout/html/base/src/nsPageFrame.cpp index a15fda7e470..648930b31e7 100644 --- a/mozilla/layout/html/base/src/nsPageFrame.cpp +++ b/mozilla/layout/html/base/src/nsPageFrame.cpp @@ -58,12 +58,12 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG PreReflowCheck(); #endif - aStatus = frComplete; // initialize out parameter + aStatus = NS_FRAME_COMPLETE; // initialize out parameter // Do we have any children? if (nsnull == mFirstChild) { @@ -95,7 +95,7 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext, // Get the child's desired size aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, aMaxSize, aMaxElementSize); - mLastContentIsComplete = PRBool(aStatus == frComplete); + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(aStatus); // Make sure the child is at least as tall as our max size (the containing window) if (aDesiredSize.height < aMaxSize.height) { @@ -107,7 +107,7 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext, mFirstChild->SetRect(rect); // Is the frame complete? - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsIFrame* childNextInFlow; mFirstChild->GetNextInFlow(childNextInFlow); @@ -130,7 +130,7 @@ NS_METHOD PageFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // We don't expect the target of the reflow command to be page frame NS_ASSERTION(aReflowCommand.GetTarget() != this, "page frame is reflow command target"); diff --git a/mozilla/layout/html/base/src/nsPageFrame.h b/mozilla/layout/html/base/src/nsPageFrame.h index 28972f714fa..11230aafbea 100644 --- a/mozilla/layout/html/base/src/nsPageFrame.h +++ b/mozilla/layout/html/base/src/nsPageFrame.h @@ -29,13 +29,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD CreateContinuingFrame(nsIPresContext* aCX, nsIFrame* aParent, diff --git a/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp b/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp index e068ae9ad4c..9a73e7487c1 100644 --- a/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp +++ b/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp @@ -53,7 +53,7 @@ NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // Get the floater container in which we're inserted nsIFloaterContainer* container = nsnull; diff --git a/mozilla/layout/html/base/src/nsPlaceholderFrame.h b/mozilla/layout/html/base/src/nsPlaceholderFrame.h index 036f98eebec..ad50593eca8 100644 --- a/mozilla/layout/html/base/src/nsPlaceholderFrame.h +++ b/mozilla/layout/html/base/src/nsPlaceholderFrame.h @@ -46,7 +46,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; NS_IMETHOD ListTag(FILE* out = stdout) const; diff --git a/mozilla/layout/html/base/src/nsRootPart.cpp b/mozilla/layout/html/base/src/nsRootPart.cpp index 6788d4d7cbb..bb718461386 100644 --- a/mozilla/layout/html/base/src/nsRootPart.cpp +++ b/mozilla/layout/html/base/src/nsRootPart.cpp @@ -43,13 +43,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD HandleEvent(nsIPresContext& aPresContext, nsGUIEvent* aEvent, @@ -65,13 +65,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD Paint(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, @@ -92,12 +92,12 @@ NS_METHOD RootFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG PreReflowCheck(); #endif - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; // Do we have any children? if (nsnull == mFirstChild) { @@ -139,7 +139,7 @@ NS_METHOD RootFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // We don't expect the target of the reflow command to be the root frame NS_ASSERTION(aReflowCommand.GetTarget() != this, "root frame is reflow command target"); @@ -291,12 +291,12 @@ NS_METHOD RootContentFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NS_DEBUG PreReflowCheck(); #endif - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; // Do we have any children? if (nsnull == mFirstChild) { @@ -315,8 +315,8 @@ NS_METHOD RootContentFrame::ResizeReflow(nsIPresContext* aPresContext, // Tile the pages vertically for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { // Reflow the page - ReflowStatus status = ReflowChild(kidFrame, aPresContext, kidSize, - pageSize, aMaxElementSize); + nsReflowStatus status = ReflowChild(kidFrame, aPresContext, kidSize, + pageSize, aMaxElementSize); // Place and size the page. If the page is narrower than our max width then // center it horizontally @@ -333,7 +333,7 @@ NS_METHOD RootContentFrame::ResizeReflow(nsIPresContext* aPresContext, nsIFrame* kidNextInFlow; kidFrame->GetNextInFlow(kidNextInFlow); - if (frComplete == status) { + if (NS_FRAME_IS_COMPLETE(status)) { NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list"); } else if (nsnull == kidNextInFlow) { // The page isn't complete and it doesn't have a next-in-flow so @@ -373,7 +373,7 @@ NS_METHOD RootContentFrame::ResizeReflow(nsIPresContext* aPresContext, // desired size aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, maxSize, aMaxElementSize); - NS_ASSERTION(frComplete == aStatus, "bad status"); + NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status"); // Place and size the child. Make sure the child is at least as // tall as our max size (the containing window) @@ -398,7 +398,7 @@ NS_METHOD RootContentFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { // We don't expect the target of the reflow command to be the root // content frame diff --git a/mozilla/layout/html/base/src/nsSpacerPart.cpp b/mozilla/layout/html/base/src/nsSpacerPart.cpp index 83a8f1214ec..98177a94ea3 100644 --- a/mozilla/layout/html/base/src/nsSpacerPart.cpp +++ b/mozilla/layout/html/base/src/nsSpacerPart.cpp @@ -38,10 +38,11 @@ class SpacerFrame : public nsFrame public: SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame); - virtual ReflowStatus ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); + NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus); protected: virtual ~SpacerFrame(); }; @@ -80,11 +81,11 @@ SpacerFrame::~SpacerFrame() { } -nsIFrame::ReflowStatus -SpacerFrame::ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) +NS_METHOD SpacerFrame::ResizeReflow(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize, + nsReflowStatus& aStatus) { // Get cached state for containing block frame nsBlockReflowState* state = nsnull; @@ -115,7 +116,8 @@ SpacerFrame::ResizeReflow(nsIPresContext* aPresContext, if (nsnull == state) { // We don't do anything unless we are in a block container somewhere - return frComplete; + aStatus = NS_FRAME_COMPLETE; + return NS_OK; } nscoord width = 0; @@ -188,7 +190,8 @@ SpacerFrame::ResizeReflow(nsIPresContext* aPresContext, break; } - return frComplete; + aStatus = NS_FRAME_COMPLETE; + return NS_OK; } //---------------------------------------------------------------------- diff --git a/mozilla/layout/html/base/src/nsTextContent.cpp b/mozilla/layout/html/base/src/nsTextContent.cpp index 76dc5378bb8..1ec6a072167 100644 --- a/mozilla/layout/html/base/src/nsTextContent.cpp +++ b/mozilla/layout/html/base/src/nsTextContent.cpp @@ -128,7 +128,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext, nsReflowMetrics& aMetrics); @@ -175,22 +175,22 @@ protected: const nsRect& aDirtyRect, nscoord dx, nscoord dy); - ReflowStatus ReflowPre(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsStyleFont& aFont, - PRInt32 aStartingOffset, - nsLineLayout* aLineState); + nsReflowStatus ReflowPre(nsIPresContext* aCX, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize, + nsStyleFont& aFont, + PRInt32 aStartingOffset, + nsLineLayout* aLineState); - ReflowStatus ReflowNormal(nsIPresContext* aCX, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - nsStyleFont& aFont, - nsStyleText& aTextStyle, - PRInt32 aStartingOffset, - nsLineLayout* aLineState); + nsReflowStatus ReflowNormal(nsIPresContext* aCX, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize, + nsStyleFont& aFont, + nsStyleText& aTextStyle, + PRInt32 aStartingOffset, + nsLineLayout* aLineState); public: PRInt32 mContentOffset; @@ -733,7 +733,7 @@ NS_METHOD TextFrame::ResizeReflow(nsIPresContext* aCX, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { #ifdef NOISY ListTag(stdout); @@ -800,7 +800,7 @@ NS_METHOD TextFrame::ResizeReflow(nsIPresContext* aCX, #ifdef NOISY ListTag(stdout); printf(": reflow %scomplete [flags=%x]\n", - ((aStatus == frComplete) ? "" : "not "), mFlags); + (NS_FRAME_IS_COMPLETE(aStatus) ? "" : "not "), mFlags); #endif return NS_OK; } @@ -808,7 +808,7 @@ NS_METHOD TextFrame::ResizeReflow(nsIPresContext* aCX, // Reflow normal text (stuff that doesn't have to deal with horizontal // tabs). Normal text reflow may or may not wrap depending on the // "whiteSpace" style property. -nsIFrame::ReflowStatus +nsReflowStatus TextFrame::ReflowNormal(nsIPresContext* aCX, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, @@ -953,7 +953,7 @@ TextFrame::ReflowNormal(nsIPresContext* aCX, aMaxElementSize->height = 0; } NS_RELEASE(fm); - return frComplete; + return NS_FRAME_COMPLETE; } } @@ -967,10 +967,10 @@ TextFrame::ReflowNormal(nsIPresContext* aCX, aMaxElementSize->height = fm->GetHeight(); } NS_RELEASE(fm); - return (cp == end) ? frComplete : frNotComplete; + return (cp == end) ? NS_FRAME_COMPLETE : 0; } -nsIFrame::ReflowStatus +nsReflowStatus TextFrame::ReflowPre(nsIPresContext* aCX, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, @@ -1044,7 +1044,7 @@ TextFrame::ReflowPre(nsIPresContext* aCX, aMaxElementSize->height = aDesiredSize.height; } NS_RELEASE(fm); - return (cp == end) ? frComplete : frNotComplete; + return (cp == end) ? NS_FRAME_COMPLETE : 0; } #define NUM_WORDS 20 diff --git a/mozilla/layout/html/forms/src/nsInputButton.cpp b/mozilla/layout/html/forms/src/nsInputButton.cpp index 7f803609f8d..43ec815eec2 100644 --- a/mozilla/layout/html/forms/src/nsInputButton.cpp +++ b/mozilla/layout/html/forms/src/nsInputButton.cpp @@ -109,7 +109,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView* aView); @@ -389,7 +389,7 @@ nsInputButtonFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if ((kButtonTag_Input == GetButtonTagType()) && (kButton_Image == GetButtonType())) { @@ -400,7 +400,7 @@ nsInputButtonFrame::ResizeReflow(nsIPresContext* aPresContext, aMaxElementSize->width = aDesiredSize.width; aMaxElementSize->height = aDesiredSize.height; } - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } else { diff --git a/mozilla/layout/html/forms/src/nsInputFrame.cpp b/mozilla/layout/html/forms/src/nsInputFrame.cpp index 2e186d1b1d1..b066bea8b4d 100644 --- a/mozilla/layout/html/forms/src/nsInputFrame.cpp +++ b/mozilla/layout/html/forms/src/nsInputFrame.cpp @@ -213,7 +213,7 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { nsIView* view = nsnull; GetView(view); @@ -230,7 +230,7 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext, (void **)&view); if (NS_OK != result) { NS_ASSERTION(0, "Could not create view for button"); - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; return result; } nsIPresShell *presShell = aPresContext->GetShell(); // need to release @@ -258,7 +258,7 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext, } if (NS_OK != result) { NS_ASSERTION(0, "widget initialization failed"); - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; return NS_OK; } @@ -300,7 +300,7 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext, aMaxElementSize->height = aDesiredSize.height; } - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/html/forms/src/nsInputFrame.h b/mozilla/layout/html/forms/src/nsInputFrame.h index 70c78672db3..ec6620b56e7 100644 --- a/mozilla/layout/html/forms/src/nsInputFrame.h +++ b/mozilla/layout/html/forms/src/nsInputFrame.h @@ -119,7 +119,7 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); // new behavior diff --git a/mozilla/layout/html/table/src/nsTableCaptionFrame.cpp b/mozilla/layout/html/table/src/nsTableCaptionFrame.cpp index e58fb551a91..d2692579db6 100644 --- a/mozilla/layout/html/table/src/nsTableCaptionFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCaptionFrame.cpp @@ -185,7 +185,7 @@ NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_PRECONDITION(nsnull!=aPresContext, "bad arg"); @@ -193,7 +193,7 @@ NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext, PreReflowCheck(); #endif - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (gsDebug==PR_TRUE) printf("nsTableCaptionFrame::ResizeReflow %p: maxSize=%d,%d\n", this, aMaxSize.width, aMaxSize.height); @@ -244,13 +244,13 @@ NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext, if (nsnull!=pMaxElementSize) printf(" nsTableCaptionFrame::ResizeReflow: child returned %s with desiredSize=%d,%d,\ and maxElementSize=%d,%d\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", kidSize.width, kidSize.height, pMaxElementSize->width, pMaxElementSize->height); else printf(" nsTableCaptionFrame::ResizeReflow: child returned %s with desiredSize=%d,%d,\ and maxElementSize=nsnull\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", kidSize.width, kidSize.height); } @@ -264,7 +264,7 @@ NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext, kidSize.width, kidSize.height)); - if (frNotComplete == aStatus) { + if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) { // If the child didn't finish layout then it means that it used // up all of our available space (or needs us to split). mLastContentIsComplete = PR_FALSE; @@ -300,12 +300,12 @@ NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext, { if (nsnull!=aMaxElementSize) printf("nsTableCaptionFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", aDesiredSize.width, aDesiredSize.height, aMaxElementSize->width, aMaxElementSize->height); else printf("nsTableCaptionFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", aDesiredSize.width, aDesiredSize.height); } @@ -320,7 +320,7 @@ NS_METHOD nsTableCaptionFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug == PR_TRUE) printf("nsTableCaptionFrame::IncrementalReflow\n"); // total hack for now, just some hard-coded values diff --git a/mozilla/layout/html/table/src/nsTableCaptionFrame.h b/mozilla/layout/html/table/src/nsTableCaptionFrame.h index 3c326c39c79..094fa643fad 100644 --- a/mozilla/layout/html/table/src/nsTableCaptionFrame.h +++ b/mozilla/layout/html/table/src/nsTableCaptionFrame.h @@ -43,13 +43,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** * @see nsContainerFrame diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index 1597e13e1ba..223f3e79ac0 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -208,7 +208,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_PRECONDITION(nsnull!=aPresContext, "bad arg"); @@ -216,7 +216,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext, //PreReflowCheck(); #endif - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (gsDebug==PR_TRUE) printf("nsTableCellFrame::ResizeReflow: maxSize=%d,%d\n", aMaxSize.width, aMaxSize.height); @@ -287,7 +287,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext, kidSize.width, kidSize.height)); - if (frNotComplete == aStatus) { + if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) { // If the child didn't finish layout then it means that it used // up all of our available space (or needs us to split). mLastContentIsComplete = PR_FALSE; @@ -329,7 +329,7 @@ NS_METHOD nsTableCellFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug == PR_TRUE) printf("nsTableCellFrame::IncrementalReflow\n"); // total hack for now, just some hard-coded values diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.h b/mozilla/layout/html/table/src/nsTableCellFrame.h index fdcf1f63525..634fb81c227 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.h +++ b/mozilla/layout/html/table/src/nsTableCellFrame.h @@ -43,13 +43,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** * @see nsContainerFrame diff --git a/mozilla/layout/html/table/src/nsTableCol.cpp b/mozilla/layout/html/table/src/nsTableCol.cpp index f689ac39b4c..c3bb33a5c29 100644 --- a/mozilla/layout/html/table/src/nsTableCol.cpp +++ b/mozilla/layout/html/table/src/nsTableCol.cpp @@ -49,13 +49,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); protected: @@ -90,7 +90,7 @@ NS_METHOD nsTableColFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_ASSERTION(nsnull!=aPresContext, "bad arg"); if (gsDebug==PR_TRUE) printf("nsTableoupFrame::ResizeReflow\n"); @@ -101,7 +101,7 @@ NS_METHOD nsTableColFrame::ResizeReflow(nsIPresContext* aPresContext, aMaxElementSize->width=0; aMaxElementSize->height=0; } - aStatus = nsIFrame::frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } @@ -109,13 +109,13 @@ NS_METHOD nsTableColFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_ASSERTION(nsnull!=aPresContext, "bad arg"); if (gsDebug==PR_TRUE) printf("nsTableColFrame::IncrementalReflow\n"); aDesiredSize.width=0; aDesiredSize.height=0; - aStatus = nsIFrame::frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp index 23fd2283b6c..493e1293ebd 100644 --- a/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp @@ -49,7 +49,7 @@ nsTableColGroupFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_ASSERTION(nsnull!=aPresContext, "bad arg"); if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::ResizeReflow\n"); @@ -60,7 +60,7 @@ nsTableColGroupFrame::ResizeReflow(nsIPresContext* aPresContext, aMaxElementSize->width=0; aMaxElementSize->height=0; } - aStatus = nsIFrame::frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } @@ -69,7 +69,7 @@ nsTableColGroupFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_ASSERTION(nsnull!=aPresContext, "bad arg"); if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::IncrementalReflow\n"); diff --git a/mozilla/layout/html/table/src/nsTableColGroupFrame.h b/mozilla/layout/html/table/src/nsTableColGroupFrame.h index 44762ddc912..dde5802a215 100644 --- a/mozilla/layout/html/table/src/nsTableColGroupFrame.h +++ b/mozilla/layout/html/table/src/nsTableColGroupFrame.h @@ -43,13 +43,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); protected: diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index a90adf1d1b0..d7e1b87620d 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -486,7 +486,7 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_PRECONDITION(nsnull != aPresContext, "null arg"); if (gsDebug==PR_TRUE) @@ -500,7 +500,7 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext, PreReflowCheck(); #endif - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; PRIntervalTime startTime; if (gsTiming) { @@ -558,10 +558,10 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext, * NOTE: should never get called on a continuing frame! All cached pass1 state * is stored in the inner table first-in-flow. */ -nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) +nsReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize) { NS_ASSERTION(nsnull!=aPresContext, "bad pres context param"); NS_ASSERTION(nsnull==mPrevInFlow, "illegal call, cannot call pass 1 on a continuing frame."); @@ -569,7 +569,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont if (gsDebug==PR_TRUE) printf("nsTableFrame::ResizeReflow Pass1: maxSize=%d,%d\n", aMaxSize.width, aMaxSize.height); if (PR_TRUE==gsDebug) printf ("*** tableframe reflow pass1\t\t%d\n", this); - ReflowStatus result = frComplete; + nsReflowStatus result = NS_FRAME_COMPLETE; mChildCount = 0; mFirstContentOffset = mLastContentOffset = 0; @@ -609,7 +609,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont for (;;) { nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++ if (kid.IsNull()) { - result = frComplete; + result = NS_FRAME_COMPLETE; break; } @@ -684,7 +684,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont prevKidFrame = kidFrame; mChildCount++; - if (frNotComplete == result) { + if (NS_FRAME_IS_NOT_COMPLETE(result)) { // If the child didn't finish layout then it means that it used // up all of our available space (or needs us to split). mLastContentIsComplete = PR_FALSE; @@ -693,7 +693,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont } contentOffset++; kidIndex++; - if (frNotComplete == result) { + if (NS_FRAME_IS_NOT_COMPLETE(result)) { // If the child didn't finish layout then it means that it used // up all of our available space (or needs us to split). mLastContentIsComplete = PR_FALSE; @@ -715,19 +715,19 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont /** the second of 2 reflow passes */ -nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - PRInt32 aMinCaptionWidth, - PRInt32 mMaxCaptionWidth) +nsReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize, + PRInt32 aMinCaptionWidth, + PRInt32 mMaxCaptionWidth) { if (PR_TRUE==gsDebug) printf ("***tableframe reflow pass2\t\t%d\n", this); if (gsDebug==PR_TRUE) printf("nsTableFrame::ResizeReflow Pass2: maxSize=%d,%d\n", aMaxSize.width, aMaxSize.height); - ReflowStatus result = frComplete; + nsReflowStatus result = NS_FRAME_COMPLETE; // now that we've computed the column width information, reflow all children nsIContent* c = mContent; @@ -749,7 +749,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont } PRBool reflowMappedOK = PR_TRUE; - ReflowStatus status = frComplete; + nsReflowStatus status = NS_FRAME_COMPLETE; // Check for an overflow list MoveOverflowToChildList(); @@ -762,7 +762,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont if (nsnull != mFirstChild) { reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); if (PR_FALSE == reflowMappedOK) { - status = frNotComplete; + status = 0; // not complete } } @@ -772,7 +772,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont if (state.availSize.height <= 0) { // No space left. Don't try to pull-up children or reflow unmapped if (NextChildOffset() < mContent->ChildCount()) { - status = frNotComplete; + status = 0; // not complete } } else if (NextChildOffset() < mContent->ChildCount()) { // Try and pull-up some children from a next-in-flow @@ -784,14 +784,14 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont } else { // We were unable to pull-up all the existing frames from the // next in flow - status = frNotComplete; + status = 0; // not complete } } } // Return our size and our status - if (frComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // Don't forget to add in the bottom margin from our last child. // Only add it in if there's room for it. nscoord margin = state.prevMaxPosBottomMargin - @@ -978,9 +978,9 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext, PRBool result = PR_TRUE; for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsSize kidAvailSize(aState.availSize); - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; + nsSize kidAvailSize(aState.availSize); + nsReflowMetrics desiredSize; + nsReflowStatus status; // Get top margin for this kid nsIContentPtr kid; @@ -1045,10 +1045,10 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext, prevKidFrame = kidFrame; // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); + mLastContentIsComplete = PRBool(NS_FRAME_IS_COMPLETE(status)); // Special handling for incomplete children - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { nsIFrame* kidNextInFlow; kidFrame->GetNextInFlow(kidNextInFlow); @@ -1189,7 +1189,7 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, while (nsnull != nextInFlow) { nsReflowMetrics kidSize; - ReflowStatus status; + nsReflowStatus status; // Get the next child nsIFrame* kidFrame = nextInFlow->mFirstChild; @@ -1277,8 +1277,8 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, prevLastContentIsComplete = mLastContentIsComplete; // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = PRBool(NS_FRAME_IS_COMPLETE(status)); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No the child isn't complete nsIFrame* kidNextInFlow; @@ -1360,7 +1360,7 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, * @return frComplete if all content has been mapped and frNotComplete * if we should be continued */ -nsIFrame::ReflowStatus +nsReflowStatus nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, InnerTableReflowState& aState, nsSize* aMaxElementSize) @@ -1369,7 +1369,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, VerifyLastIsComplete(); #endif nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; + nsReflowStatus result = 0; // not complete // If we have no children and we have a prev-in-flow then we need to pick // up where it left off. If we have children, e.g. we're being resized, then @@ -1397,7 +1397,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); if (kid.IsNull()) { - result = frComplete; + result = NS_FRAME_COMPLETE; break; } @@ -1429,7 +1429,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Try to reflow the child into the available space. It might not // fit or might need continuing. nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, + nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, aState.availSize, pKidMaxElementSize); // Did the child fit? @@ -1465,7 +1465,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, kidIndex++; // Did the child complete? - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // If the child isn't complete then it means that we've used up // all of our available space mLastContentIsComplete = PR_FALSE; @@ -1860,7 +1860,7 @@ NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext* aCX, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_ASSERTION(nsnull != aCX, "bad arg"); if (gsDebug==PR_TRUE) printf ("nsTableFrame::IncrementalReflow: maxSize=%d,%d\n", @@ -1870,7 +1870,7 @@ NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext* aCX, aDesiredSize.width = mRect.width; aDesiredSize.height = mRect.height; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/html/table/src/nsTableFrame.h b/mozilla/layout/html/table/src/nsTableFrame.h index 88599c72f4f..d58d93bcb34 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.h +++ b/mozilla/layout/html/table/src/nsTableFrame.h @@ -85,14 +85,14 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsIFrame::IncrementalReflow */ NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsContainerFrame::CreateContinuingFrame */ NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, @@ -191,10 +191,10 @@ protected: * * @see ResizeReflow */ - virtual ReflowStatus ResizeReflowPass1(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); + virtual nsReflowStatus ResizeReflowPass1(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize); /** second pass of ResizeReflow. * lays out all table content with aMaxSize(computed_table_width, given_table_height) @@ -207,12 +207,12 @@ protected: * @see ResizeReflow * @see NeedsReflow */ - virtual ReflowStatus ResizeReflowPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - PRInt32 aMinCaptionWidth, - PRInt32 mMaxCaptionWidth); + virtual nsReflowStatus ResizeReflowPass2(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize, + PRInt32 aMinCaptionWidth, + PRInt32 mMaxCaptionWidth); nscoord GetTopMarginFor(nsIPresContext* aCX, InnerTableReflowState& aState, @@ -256,9 +256,9 @@ protected: * @return frComplete if all content has been mapped and frNotComplete * if we should be continued */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize); + nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, + InnerTableReflowState& aState, + nsSize* aMaxElementSize); /** assign widths for each column, taking into account the table content, the effective style, diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp index 84de6ac9b82..ea85d0440e8 100644 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp @@ -166,7 +166,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (PR_TRUE==gsDebug) printf ("***table outer frame reflow \t\t%p\n", this); @@ -187,7 +187,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsSize innerTableMaxElementSize(0,0); // Set up our kids. They're already present, on an overflow list, @@ -204,7 +204,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, NS_ASSERTION(nsnull!=mInnerTableFrame, "no mInnerTableFrame"); if (nsnull==mFirstChild || nsnull==mInnerTableFrame) { //ERROR! - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } @@ -260,7 +260,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, if (nsnull != mFirstChild) { reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } @@ -270,7 +270,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, if (state.availSize.height <= 0) { // No space left. Don't try to pull-up children or reflow unmapped if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } else if (NextChildOffset() < mContent->ChildCount()) { // Try and pull-up some children from a next-in-flow @@ -279,12 +279,12 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, NS_ABORT(); // huge error for tables! } else { // We were unable to pull-up all the existing frames from the next in flow - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } } - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { // Don't forget to add in the bottom margin from our last child. // Only add it in if there's room for it. nscoord margin = state.prevMaxPosBottomMargin - @@ -301,7 +301,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, /* if we're incomplete, take up all the remaining height so we don't waste time * trying to lay out in a slot that we know isn't tall enough to fit our minimum. * otherwise, we're as tall as our kids want us to be */ - if (frNotComplete == aStatus) + if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) aDesiredSize.height = aMaxSize.height; else aDesiredSize.height = state.y; @@ -310,12 +310,12 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, { if (nsnull!=aMaxElementSize) printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and aMaxElementSize=%d,%d\n", - aStatus==frComplete ? "Complete" : "Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)? "Complete" : "Not Complete", aDesiredSize.width, aDesiredSize.height, aMaxElementSize->width, aMaxElementSize->height); else printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and NSNULL aMaxElementSize\n", - aStatus==frComplete ? "Complete" : "Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)? "Complete" : "Not Complete", aDesiredSize.width, aDesiredSize.height); } @@ -449,8 +449,8 @@ PRBool nsTableOuterFrame::ReflowMappedChildren( nsIPresContext* aPresContex PRBool result = PR_TRUE; aState.availSize.width = aState.innerTableMaxSize.width; for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsReflowMetrics kidSize; - nsIFrame::ReflowStatus status; + nsReflowMetrics kidSize; + nsReflowStatus status; SetReflowState(aState, kidFrame); @@ -517,9 +517,9 @@ PRBool nsTableOuterFrame::ReflowMappedChildren( nsIPresContext* aPresContex prevKidFrame = kidFrame; // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No, the child isn't complete nsIFrame* kidNextInFlow; @@ -670,8 +670,8 @@ PRBool nsTableOuterFrame::PullUpChildren( nsIPresContext* aPresContext, PRBool result = PR_TRUE; while (nsnull != nextInFlow) { - nsReflowMetrics kidSize; - ReflowStatus status; + nsReflowMetrics kidSize; + nsReflowStatus status; // Get the next child nsIFrame* kidFrame = nextInFlow->mFirstChild; @@ -756,8 +756,8 @@ PRBool nsTableOuterFrame::PullUpChildren( nsIPresContext* aPresContext, prevLastContentIsComplete = mLastContentIsComplete; // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No the child isn't complete nsIFrame* kidNextInFlow; @@ -875,7 +875,7 @@ void nsTableOuterFrame::SetReflowState(OuterTableReflowState& aState, nsIFrame* * child is complete and it has next-in-flows (it was a splittable child) * then delete the next-in-flows. */ -nsIFrame::ReflowStatus +nsReflowStatus nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame, nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, @@ -883,7 +883,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame, nsSize* aMaxElementSize, OuterTableReflowState& aState) { - ReflowStatus status; + nsReflowStatus status; /* call the appropriate reflow method based on the type and position of the child */ if (PR_TRUE==aState.processingCaption) @@ -922,7 +922,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame, { } - if (frComplete == status) { + if (NS_FRAME_IS_COMPLETE(status)) { nsIFrame* kidNextInFlow; aKidFrame->GetNextInFlow(kidNextInFlow); @@ -1017,7 +1017,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext) } -nsIFrame::ReflowStatus +nsReflowStatus nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext) { if (nsnull!=mCaptionFrames) @@ -1029,7 +1029,7 @@ nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext) nsSize maxSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); nsReflowMetrics desiredSize; nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mCaptionFrames->ElementAt(captionIndex); - ReflowStatus status; + nsReflowStatus status; captionFrame->ResizeReflow(aPresContext, desiredSize, maxSize, &maxElementSize, status); if (mMinCaptionWidth=kidAvailSize.height) kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; + nsReflowMetrics desiredSize; + nsReflowStatus status; // Get top margin for this kid nsIStyleContext* kidSC; @@ -322,12 +322,12 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext, { if (nsnull!=pKidMaxElementSize) printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height, pKidMaxElementSize->width, pKidMaxElementSize->height); else printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height); } } @@ -372,7 +372,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext, prevKidFrame = kidFrame; // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); /* Rows should not create continuing frames for cells * unless they absolutely have to! @@ -380,7 +380,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext, * otherwise PushChildren and bail. */ // Special handling for incomplete children - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // XXX It's good to assume that we might still have room // even if the child didn't complete (floaters will want this) nsIFrame* kidNextInFlow; @@ -530,7 +530,7 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext, while (nsnull != nextInFlow) { nsReflowMetrics desiredSize; - ReflowStatus status; + nsReflowStatus status; // Get the next child nsIFrame* kidFrame = nextInFlow->mFirstChild; @@ -586,12 +586,12 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext, { if (nsnull!=pKidMaxElementSize) printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height, pKidMaxElementSize->width, pKidMaxElementSize->height); else printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height); } } @@ -646,8 +646,8 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext, prevLastContentIsComplete = mLastContentIsComplete; // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No the child isn't complete nsIFrame* kidNextInFlow; @@ -746,10 +746,10 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext, * * @param aPresContext presentation context to use * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete + * @return NS_FRAME_COMPLETE if all content has been mapped and NS_FRAME_NOT_COMPLETE * if we should be continued */ -nsIFrame::ReflowStatus +nsReflowStatus nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, RowReflowState& aState, nsSize* aMaxElementSize) @@ -758,7 +758,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, VerifyLastIsComplete(); #endif nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; + nsReflowStatus result = 0; // not complete // If we have no children and we have a prev-in-flow then we need to pick // up where it left off. If we have children, e.g. we're being resized, then @@ -789,13 +789,13 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, // Get the next content object nsIContent* cell = mContent->ChildAt(kidIndex); if (nsnull == cell) { - result = frComplete; + result = NS_FRAME_COMPLETE; break; } // Make sure we still have room left if (aState.availSize.height <= 0) { - // Note: return status was set to frNotComplete above... + // Note: return status was set to NS_FRAME_NOT_COMPLETE above... NS_RELEASE(cell); // cell: REFCNT--(a) break; } @@ -826,7 +826,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, // Try to reflow the child into the available space. It might not // fit or might need continuing. nsReflowMetrics desiredSize; - ReflowStatus status; + nsReflowStatus status; if (NS_UNCONSTRAINEDSIZE == aState.availSize.width) { // Reflow the child into the available space @@ -854,12 +854,12 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, { if (nsnull!=pKidMaxElementSize) printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height, pKidMaxElementSize->width, pKidMaxElementSize->height); else printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height); } } @@ -900,7 +900,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, kidIndex++; // Did the child complete? - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // If the child isn't complete then it means that we've used up // all of our available space mLastContentIsComplete = PR_FALSE; @@ -934,7 +934,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::ResizeReflow - aMaxSize = %d, %d\n", @@ -954,7 +954,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; // Check for an overflow list MoveOverflowToChildList(); @@ -966,7 +966,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, if (nsnull != mFirstChild) { reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } @@ -976,7 +976,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, if (state.availSize.height <= 0) { // No space left. Don't try to pull-up children or reflow unmapped if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } else if (NextChildOffset() < mContent->ChildCount()) { // Try and pull-up some children from a next-in-flow @@ -988,12 +988,12 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, } else { // We were unable to pull-up all the existing frames from the // next in flow - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } } - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { // Don't forget to add in the bottom margin from our last child. // Only add it in if there's room for it. nscoord margin = state.prevMaxPosBottomMargin - @@ -1012,12 +1012,12 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, { if (nsnull!=aMaxElementSize) printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", aDesiredSize.width, aDesiredSize.height, aMaxElementSize->width, aMaxElementSize->height); else printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", aDesiredSize.width, aDesiredSize.height); } @@ -1030,10 +1030,10 @@ nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::IncrementalReflow\n"); - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.h b/mozilla/layout/html/table/src/nsTableRowFrame.h index e84cfb28d2f..8a7d1d53005 100644 --- a/mozilla/layout/html/table/src/nsTableRowFrame.h +++ b/mozilla/layout/html/table/src/nsTableRowFrame.h @@ -81,14 +81,14 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsIFrame::IncrementalReflow */ NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsContainerFrame::CreateContinuingFrame */ NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, @@ -159,9 +159,9 @@ protected: * @return frComplete if all content has been mapped and frNotComplete * if we should be continued */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize); + nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, + RowReflowState& aState, + nsSize* aMaxElementSize); private: diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp index bc77cceed71..da6036a2a5d 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -270,8 +270,8 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon nsSize kidAvailSize(aState.availSize); if (0>=kidAvailSize.height) kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; + nsReflowMetrics desiredSize; + nsReflowStatus status; // Get top margin for this kid nsIContentPtr kid; @@ -340,7 +340,7 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon prevKidFrame = kidFrame; // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); /* Row groups should not create continuing frames for rows * unless they absolutely have to! @@ -348,7 +348,7 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon * otherwise PushChildren and bail. */ // Special handling for incomplete children - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // XXX It's good to assume that we might still have room // even if the child didn't complete (floaters will want this) nsIFrame* kidNextInFlow; @@ -495,7 +495,7 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, while (nsnull != nextInFlow) { nsReflowMetrics kidSize; - ReflowStatus status; + nsReflowStatus status; // Get the next child nsIFrame* kidFrame = nextInFlow->mFirstChild; @@ -579,8 +579,8 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, prevLastContentIsComplete = mLastContentIsComplete; // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No the child isn't complete nsIFrame* kidNextInFlow; @@ -682,7 +682,7 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, * @return frComplete if all content has been mapped and frNotComplete * if we should be continued */ -nsIFrame::ReflowStatus +nsReflowStatus nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, RowGroupReflowState& aState, nsSize* aMaxElementSize) @@ -690,8 +690,8 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, #ifdef NS_DEBUG VerifyLastIsComplete(); #endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; + nsIFrame* kidPrevInFlow = nsnull; + nsReflowStatus result = 0; // not complete // If we have no children and we have a prev-in-flow then we need to pick // up where it left off. If we have children, e.g. we're being resized, then @@ -721,7 +721,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); if (kid.IsNull()) { - result = frComplete; + result = NS_FRAME_COMPLETE; break; } @@ -756,8 +756,8 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Try to reflow the child into the available space. It might not // fit or might need continuing. nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, - aState.availSize, pKidMaxElementSize); + nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, + aState.availSize, pKidMaxElementSize); // Did the child fit? if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { @@ -788,7 +788,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, kidIndex++; // Did the child complete? - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // If the child isn't complete then it means that we've used up // all of our available space mLastContentIsComplete = PR_FALSE; @@ -820,7 +820,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug1==PR_TRUE) printf("nsTableRowGroupFrame::ResizeReflow - aMaxSize = %d, %d\n", @@ -837,7 +837,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; // Check for an overflow list MoveOverflowToChildList(); @@ -848,7 +848,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, if (nsnull != mFirstChild) { reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } @@ -858,7 +858,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, if (state.availSize.height <= 0) { // No space left. Don't try to pull-up children or reflow unmapped if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } else if (NextChildOffset() < mContent->ChildCount()) { // Try and pull-up some children from a next-in-flow @@ -870,12 +870,12 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, } else { // We were unable to pull-up all the existing frames from the // next in flow - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } } - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { // Don't forget to add in the bottom margin from our last child. // Only add it in if there's room for it. nscoord margin = state.prevMaxPosBottomMargin - @@ -899,12 +899,12 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, { if (nsnull!=aMaxElementSize) printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", aDesiredSize.width, aDesiredSize.height, aMaxElementSize->width, aMaxElementSize->height); else printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", aDesiredSize.width, aDesiredSize.height); } @@ -917,7 +917,7 @@ nsTableRowGroupFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug1==PR_TRUE) printf("nsTableRowGroupFrame::IncrementalReflow\n"); @@ -925,7 +925,7 @@ nsTableRowGroupFrame::IncrementalReflow(nsIPresContext* aPresContext, aDesiredSize.width = aMaxSize.width; aDesiredSize.height = aMaxSize.height; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.h b/mozilla/layout/html/table/src/nsTableRowGroupFrame.h index 23edb9aca3c..04bb9d7d574 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.h +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.h @@ -76,13 +76,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsIFrame::IncrementalReflow */ NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsContainerFrame::CreateContinuingFrame */ NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, @@ -152,9 +152,9 @@ protected: * @return frComplete if all content has been mapped and frNotComplete * if we should be continued */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize); + nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, + RowGroupReflowState& aState, + nsSize* aMaxElementSize); private: nsIAtom *mType; diff --git a/mozilla/layout/html/tests/TestInlineFrame.cpp b/mozilla/layout/html/tests/TestInlineFrame.cpp index 0cdb776ba76..cf7bc23d07b 100644 --- a/mozilla/layout/html/tests/TestInlineFrame.cpp +++ b/mozilla/layout/html/tests/TestInlineFrame.cpp @@ -67,10 +67,10 @@ public: FixedSizeFrame(nsIContent* aContent, nsIFrame* aParentFrame); - ReflowStatus ResizeReflow(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); + nsReflowStatus ResizeReflow(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize); PRBool IsSplittable() const; }; @@ -108,7 +108,7 @@ FixedSizeFrame::FixedSizeFrame(nsIContent* aContent, { } -nsIFrame::ReflowStatus +nsReflowStatus FixedSizeFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, @@ -116,7 +116,7 @@ FixedSizeFrame::ResizeReflow(nsIPresContext* aPresContext, { NS_PRECONDITION((aMaxSize.width > 0) && (aMaxSize.height > 0), "bad max size"); FixedSizeContent* content = (FixedSizeContent*)mContent; - ReflowStatus status = frComplete; + nsReflowStatus status = NS_FRAME_COMPLETE; FixedSizeFrame* prevInFlow = (FixedSizeFrame*)mPrevInFlow; aDesiredSize.width = content->GetWidth(); @@ -127,7 +127,7 @@ FixedSizeFrame::ResizeReflow(nsIPresContext* aPresContext, aDesiredSize.width -= prevInFlow->mRect.width; } else if ((aDesiredSize.width > aMaxSize.width) && content->IsSplittable()) { aDesiredSize.width = aMaxSize.width; - status = frNotComplete; + status = NS_FRAME_NOT_COMPLETE; } aDesiredSize.ascent = aDesiredSize.height; @@ -283,14 +283,14 @@ TestReflowUnmapped(nsIPresContext* presContext) f->SetStyleContext(presContext,styleContext); // Reflow the HTML container - nsReflowMetrics reflowMetrics; - nsSize maxSize(1000, 1000); - nsIFrame::ReflowStatus status; + nsReflowMetrics reflowMetrics; + nsSize maxSize(1000, 1000); + nsReflowStatus status; status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); // Make sure the frame is complete - if (status != nsIFrame::frComplete) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { printf("ReflowUnmapped: initial reflow not complete: %d\n", status); return PR_FALSE; } @@ -380,14 +380,14 @@ TestChildrenThatDontFit(nsIPresContext* presContext) // Reflow the frame with a width narrower than the first child frame. This // tests how we handle one child that doesn't fit when reflowing unmapped - nsReflowMetrics reflowMetrics; - nsSize maxSize(10, 1000); - nsIFrame::ReflowStatus status; + nsReflowMetrics reflowMetrics; + nsSize maxSize(10, 1000); + nsReflowStatus status; status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); // Verify that the inline frame is complete - if (status != nsIFrame::frComplete) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { printf("ChildrenThatDontFIt: reflow unmapped isn't complete (#1a): %d\n", status); return PR_FALSE; } @@ -415,7 +415,7 @@ TestChildrenThatDontFit(nsIPresContext* presContext) status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); // Verify that the frame is not complete - if (status != nsIFrame::frNotComplete) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { printf("ChildrenThatDontFIt: reflow unmapped isn't not complete (#1b): %d\n", status); return PR_FALSE; } @@ -452,7 +452,7 @@ TestChildrenThatDontFit(nsIPresContext* presContext) status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); // Verify the frame is complete - if (status != nsIFrame::frComplete) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { printf("ChildrenThatDontFit: resize isn't complete (#2): %d\n", status); return PR_FALSE; } @@ -479,7 +479,7 @@ TestChildrenThatDontFit(nsIPresContext* presContext) status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); // Verify the frame is complete and we still have all the child frames - if ((status != nsIFrame::frComplete) || (f1->ChildCount() != b->ChildCount())) { + if (NS_FRAME_IS_NOT_COMPLETE(status) || (f1->ChildCount() != b->ChildCount())) { printf("ChildrenThatDontFit: reflow mapped failed (#3)\n"); return PR_FALSE; } @@ -500,7 +500,7 @@ TestChildrenThatDontFit(nsIPresContext* presContext) status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); // Verify the frame is not complete - if (status != nsIFrame::frNotComplete) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { printf("ChildrenThatDontFIt: reflow mapped isn't not complete (#4): %d\n", status); return PR_FALSE; } @@ -551,9 +551,9 @@ TestOverflow(nsIPresContext* presContext) // Test #1 // Reflow the frame so only half the second frame fits - nsReflowMetrics reflowMetrics; - nsSize maxSize(150, 1000); - nsIFrame::ReflowStatus status; + nsReflowMetrics reflowMetrics; + nsSize maxSize(150, 1000); + nsReflowStatus status; status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); @@ -601,7 +601,7 @@ TestOverflow(nsIPresContext* presContext) // Reflow the continuing frame. It should get its children from the overflow list maxSize.width = 1000; status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad continuing frame"); + NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad continuing frame"); // Verify that the overflow list is now empty if (nsnull != f->OverflowList()) { @@ -660,12 +660,12 @@ TestPushingPulling(nsIPresContext* presContext) f->SetStyleContext(presContext,styleContext); // Reflow the inline frame so only the first frame fits - nsReflowMetrics reflowMetrics; - nsSize maxSize(100, 1000); - nsIFrame::ReflowStatus status; + nsReflowMetrics reflowMetrics; + nsSize maxSize(100, 1000); + nsReflowStatus status; status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); + NS_ASSERTION(NS_FRAME_IS_NOT_COMPLETE(status), "bad status"); NS_ASSERTION(f->ChildCount() == 1, "bad child count"); /////////////////////////////////////////////////////////////////////////// @@ -687,7 +687,7 @@ TestPushingPulling(nsIPresContext* presContext) // children maxSize.width = 1000; status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frComplete == status, "bad continuing frame"); + NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad continuing frame"); // Verify that the continuing inline frame has the remaining children if (f1->ChildCount() != (b->ChildCount() - f->ChildCount())) { @@ -733,7 +733,7 @@ TestPushingPulling(nsIPresContext* presContext) // child frames maxSize.width = f->FirstChild()->GetWidth(); status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); - NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status"); + NS_ASSERTION(NS_FRAME_IS_NOT_COMPLETE(status), "bad status"); NS_ASSERTION(f->ChildCount() == 1, "bad child count"); // Verify the last content offset of the first inline frame @@ -883,7 +883,7 @@ TestPushingPulling(nsIPresContext* presContext) status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); // Verify that the inline frame is complete - if (nsIFrame::frComplete != status) { + if (NS_FRAME_NOT_IS_COMPLETE(status)) { printf("PushPull: failed to pull-up across empty frame (#6)\n"); return PR_FALSE; } @@ -941,7 +941,7 @@ TestPushingPulling(nsIPresContext* presContext) status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull); // Verify that the first inline frame is not complete - if (nsIFrame::frNotComplete != status) { + if (NS_FRAME_IS_COMPLETE(status)) { printf("PushPull: bad status (#7)\n"); return PR_FALSE; } diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index 1597e13e1ba..223f3e79ac0 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -208,7 +208,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_PRECONDITION(nsnull!=aPresContext, "bad arg"); @@ -216,7 +216,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext, //PreReflowCheck(); #endif - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; if (gsDebug==PR_TRUE) printf("nsTableCellFrame::ResizeReflow: maxSize=%d,%d\n", aMaxSize.width, aMaxSize.height); @@ -287,7 +287,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext, kidSize.width, kidSize.height)); - if (frNotComplete == aStatus) { + if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) { // If the child didn't finish layout then it means that it used // up all of our available space (or needs us to split). mLastContentIsComplete = PR_FALSE; @@ -329,7 +329,7 @@ NS_METHOD nsTableCellFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug == PR_TRUE) printf("nsTableCellFrame::IncrementalReflow\n"); // total hack for now, just some hard-coded values diff --git a/mozilla/layout/tables/nsTableCellFrame.h b/mozilla/layout/tables/nsTableCellFrame.h index fdcf1f63525..634fb81c227 100644 --- a/mozilla/layout/tables/nsTableCellFrame.h +++ b/mozilla/layout/tables/nsTableCellFrame.h @@ -43,13 +43,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** * @see nsContainerFrame diff --git a/mozilla/layout/tables/nsTableColGroupFrame.cpp b/mozilla/layout/tables/nsTableColGroupFrame.cpp index 23fd2283b6c..493e1293ebd 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableColGroupFrame.cpp @@ -49,7 +49,7 @@ nsTableColGroupFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_ASSERTION(nsnull!=aPresContext, "bad arg"); if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::ResizeReflow\n"); @@ -60,7 +60,7 @@ nsTableColGroupFrame::ResizeReflow(nsIPresContext* aPresContext, aMaxElementSize->width=0; aMaxElementSize->height=0; } - aStatus = nsIFrame::frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } @@ -69,7 +69,7 @@ nsTableColGroupFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_ASSERTION(nsnull!=aPresContext, "bad arg"); if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::IncrementalReflow\n"); diff --git a/mozilla/layout/tables/nsTableColGroupFrame.h b/mozilla/layout/tables/nsTableColGroupFrame.h index 44762ddc912..dde5802a215 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.h +++ b/mozilla/layout/tables/nsTableColGroupFrame.h @@ -43,13 +43,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); protected: diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index a90adf1d1b0..d7e1b87620d 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -486,7 +486,7 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_PRECONDITION(nsnull != aPresContext, "null arg"); if (gsDebug==PR_TRUE) @@ -500,7 +500,7 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext, PreReflowCheck(); #endif - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; PRIntervalTime startTime; if (gsTiming) { @@ -558,10 +558,10 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext, * NOTE: should never get called on a continuing frame! All cached pass1 state * is stored in the inner table first-in-flow. */ -nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize) +nsReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize) { NS_ASSERTION(nsnull!=aPresContext, "bad pres context param"); NS_ASSERTION(nsnull==mPrevInFlow, "illegal call, cannot call pass 1 on a continuing frame."); @@ -569,7 +569,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont if (gsDebug==PR_TRUE) printf("nsTableFrame::ResizeReflow Pass1: maxSize=%d,%d\n", aMaxSize.width, aMaxSize.height); if (PR_TRUE==gsDebug) printf ("*** tableframe reflow pass1\t\t%d\n", this); - ReflowStatus result = frComplete; + nsReflowStatus result = NS_FRAME_COMPLETE; mChildCount = 0; mFirstContentOffset = mLastContentOffset = 0; @@ -609,7 +609,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont for (;;) { nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++ if (kid.IsNull()) { - result = frComplete; + result = NS_FRAME_COMPLETE; break; } @@ -684,7 +684,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont prevKidFrame = kidFrame; mChildCount++; - if (frNotComplete == result) { + if (NS_FRAME_IS_NOT_COMPLETE(result)) { // If the child didn't finish layout then it means that it used // up all of our available space (or needs us to split). mLastContentIsComplete = PR_FALSE; @@ -693,7 +693,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont } contentOffset++; kidIndex++; - if (frNotComplete == result) { + if (NS_FRAME_IS_NOT_COMPLETE(result)) { // If the child didn't finish layout then it means that it used // up all of our available space (or needs us to split). mLastContentIsComplete = PR_FALSE; @@ -715,19 +715,19 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont /** the second of 2 reflow passes */ -nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - PRInt32 aMinCaptionWidth, - PRInt32 mMaxCaptionWidth) +nsReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize, + PRInt32 aMinCaptionWidth, + PRInt32 mMaxCaptionWidth) { if (PR_TRUE==gsDebug) printf ("***tableframe reflow pass2\t\t%d\n", this); if (gsDebug==PR_TRUE) printf("nsTableFrame::ResizeReflow Pass2: maxSize=%d,%d\n", aMaxSize.width, aMaxSize.height); - ReflowStatus result = frComplete; + nsReflowStatus result = NS_FRAME_COMPLETE; // now that we've computed the column width information, reflow all children nsIContent* c = mContent; @@ -749,7 +749,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont } PRBool reflowMappedOK = PR_TRUE; - ReflowStatus status = frComplete; + nsReflowStatus status = NS_FRAME_COMPLETE; // Check for an overflow list MoveOverflowToChildList(); @@ -762,7 +762,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont if (nsnull != mFirstChild) { reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); if (PR_FALSE == reflowMappedOK) { - status = frNotComplete; + status = 0; // not complete } } @@ -772,7 +772,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont if (state.availSize.height <= 0) { // No space left. Don't try to pull-up children or reflow unmapped if (NextChildOffset() < mContent->ChildCount()) { - status = frNotComplete; + status = 0; // not complete } } else if (NextChildOffset() < mContent->ChildCount()) { // Try and pull-up some children from a next-in-flow @@ -784,14 +784,14 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont } else { // We were unable to pull-up all the existing frames from the // next in flow - status = frNotComplete; + status = 0; // not complete } } } // Return our size and our status - if (frComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // Don't forget to add in the bottom margin from our last child. // Only add it in if there's room for it. nscoord margin = state.prevMaxPosBottomMargin - @@ -978,9 +978,9 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext, PRBool result = PR_TRUE; for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsSize kidAvailSize(aState.availSize); - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; + nsSize kidAvailSize(aState.availSize); + nsReflowMetrics desiredSize; + nsReflowStatus status; // Get top margin for this kid nsIContentPtr kid; @@ -1045,10 +1045,10 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext, prevKidFrame = kidFrame; // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); + mLastContentIsComplete = PRBool(NS_FRAME_IS_COMPLETE(status)); // Special handling for incomplete children - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { nsIFrame* kidNextInFlow; kidFrame->GetNextInFlow(kidNextInFlow); @@ -1189,7 +1189,7 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, while (nsnull != nextInFlow) { nsReflowMetrics kidSize; - ReflowStatus status; + nsReflowStatus status; // Get the next child nsIFrame* kidFrame = nextInFlow->mFirstChild; @@ -1277,8 +1277,8 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, prevLastContentIsComplete = mLastContentIsComplete; // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = PRBool(NS_FRAME_IS_COMPLETE(status)); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No the child isn't complete nsIFrame* kidNextInFlow; @@ -1360,7 +1360,7 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, * @return frComplete if all content has been mapped and frNotComplete * if we should be continued */ -nsIFrame::ReflowStatus +nsReflowStatus nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, InnerTableReflowState& aState, nsSize* aMaxElementSize) @@ -1369,7 +1369,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, VerifyLastIsComplete(); #endif nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; + nsReflowStatus result = 0; // not complete // If we have no children and we have a prev-in-flow then we need to pick // up where it left off. If we have children, e.g. we're being resized, then @@ -1397,7 +1397,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); if (kid.IsNull()) { - result = frComplete; + result = NS_FRAME_COMPLETE; break; } @@ -1429,7 +1429,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Try to reflow the child into the available space. It might not // fit or might need continuing. nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, + nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, aState.availSize, pKidMaxElementSize); // Did the child fit? @@ -1465,7 +1465,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, kidIndex++; // Did the child complete? - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // If the child isn't complete then it means that we've used up // all of our available space mLastContentIsComplete = PR_FALSE; @@ -1860,7 +1860,7 @@ NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext* aCX, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { NS_ASSERTION(nsnull != aCX, "bad arg"); if (gsDebug==PR_TRUE) printf ("nsTableFrame::IncrementalReflow: maxSize=%d,%d\n", @@ -1870,7 +1870,7 @@ NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext* aCX, aDesiredSize.width = mRect.width; aDesiredSize.height = mRect.height; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/tables/nsTableFrame.h b/mozilla/layout/tables/nsTableFrame.h index 88599c72f4f..d58d93bcb34 100644 --- a/mozilla/layout/tables/nsTableFrame.h +++ b/mozilla/layout/tables/nsTableFrame.h @@ -85,14 +85,14 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsIFrame::IncrementalReflow */ NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsContainerFrame::CreateContinuingFrame */ NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, @@ -191,10 +191,10 @@ protected: * * @see ResizeReflow */ - virtual ReflowStatus ResizeReflowPass1(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize); + virtual nsReflowStatus ResizeReflowPass1(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize); /** second pass of ResizeReflow. * lays out all table content with aMaxSize(computed_table_width, given_table_height) @@ -207,12 +207,12 @@ protected: * @see ResizeReflow * @see NeedsReflow */ - virtual ReflowStatus ResizeReflowPass2(nsIPresContext* aPresContext, - nsReflowMetrics& aDesiredSize, - const nsSize& aMaxSize, - nsSize* aMaxElementSize, - PRInt32 aMinCaptionWidth, - PRInt32 mMaxCaptionWidth); + virtual nsReflowStatus ResizeReflowPass2(nsIPresContext* aPresContext, + nsReflowMetrics& aDesiredSize, + const nsSize& aMaxSize, + nsSize* aMaxElementSize, + PRInt32 aMinCaptionWidth, + PRInt32 mMaxCaptionWidth); nscoord GetTopMarginFor(nsIPresContext* aCX, InnerTableReflowState& aState, @@ -256,9 +256,9 @@ protected: * @return frComplete if all content has been mapped and frNotComplete * if we should be continued */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - InnerTableReflowState& aState, - nsSize* aMaxElementSize); + nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, + InnerTableReflowState& aState, + nsSize* aMaxElementSize); /** assign widths for each column, taking into account the table content, the effective style, diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp index 84de6ac9b82..ea85d0440e8 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ b/mozilla/layout/tables/nsTableOuterFrame.cpp @@ -166,7 +166,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (PR_TRUE==gsDebug) printf ("***table outer frame reflow \t\t%p\n", this); @@ -187,7 +187,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; nsSize innerTableMaxElementSize(0,0); // Set up our kids. They're already present, on an overflow list, @@ -204,7 +204,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, NS_ASSERTION(nsnull!=mInnerTableFrame, "no mInnerTableFrame"); if (nsnull==mFirstChild || nsnull==mInnerTableFrame) { //ERROR! - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } @@ -260,7 +260,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, if (nsnull != mFirstChild) { reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } @@ -270,7 +270,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, if (state.availSize.height <= 0) { // No space left. Don't try to pull-up children or reflow unmapped if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } else if (NextChildOffset() < mContent->ChildCount()) { // Try and pull-up some children from a next-in-flow @@ -279,12 +279,12 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, NS_ABORT(); // huge error for tables! } else { // We were unable to pull-up all the existing frames from the next in flow - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } } - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { // Don't forget to add in the bottom margin from our last child. // Only add it in if there's room for it. nscoord margin = state.prevMaxPosBottomMargin - @@ -301,7 +301,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, /* if we're incomplete, take up all the remaining height so we don't waste time * trying to lay out in a slot that we know isn't tall enough to fit our minimum. * otherwise, we're as tall as our kids want us to be */ - if (frNotComplete == aStatus) + if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) aDesiredSize.height = aMaxSize.height; else aDesiredSize.height = state.y; @@ -310,12 +310,12 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext, { if (nsnull!=aMaxElementSize) printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and aMaxElementSize=%d,%d\n", - aStatus==frComplete ? "Complete" : "Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)? "Complete" : "Not Complete", aDesiredSize.width, aDesiredSize.height, aMaxElementSize->width, aMaxElementSize->height); else printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and NSNULL aMaxElementSize\n", - aStatus==frComplete ? "Complete" : "Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)? "Complete" : "Not Complete", aDesiredSize.width, aDesiredSize.height); } @@ -449,8 +449,8 @@ PRBool nsTableOuterFrame::ReflowMappedChildren( nsIPresContext* aPresContex PRBool result = PR_TRUE; aState.availSize.width = aState.innerTableMaxSize.width; for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) { - nsReflowMetrics kidSize; - nsIFrame::ReflowStatus status; + nsReflowMetrics kidSize; + nsReflowStatus status; SetReflowState(aState, kidFrame); @@ -517,9 +517,9 @@ PRBool nsTableOuterFrame::ReflowMappedChildren( nsIPresContext* aPresContex prevKidFrame = kidFrame; // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No, the child isn't complete nsIFrame* kidNextInFlow; @@ -670,8 +670,8 @@ PRBool nsTableOuterFrame::PullUpChildren( nsIPresContext* aPresContext, PRBool result = PR_TRUE; while (nsnull != nextInFlow) { - nsReflowMetrics kidSize; - ReflowStatus status; + nsReflowMetrics kidSize; + nsReflowStatus status; // Get the next child nsIFrame* kidFrame = nextInFlow->mFirstChild; @@ -756,8 +756,8 @@ PRBool nsTableOuterFrame::PullUpChildren( nsIPresContext* aPresContext, prevLastContentIsComplete = mLastContentIsComplete; // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No the child isn't complete nsIFrame* kidNextInFlow; @@ -875,7 +875,7 @@ void nsTableOuterFrame::SetReflowState(OuterTableReflowState& aState, nsIFrame* * child is complete and it has next-in-flows (it was a splittable child) * then delete the next-in-flows. */ -nsIFrame::ReflowStatus +nsReflowStatus nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame, nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, @@ -883,7 +883,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame, nsSize* aMaxElementSize, OuterTableReflowState& aState) { - ReflowStatus status; + nsReflowStatus status; /* call the appropriate reflow method based on the type and position of the child */ if (PR_TRUE==aState.processingCaption) @@ -922,7 +922,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame, { } - if (frComplete == status) { + if (NS_FRAME_IS_COMPLETE(status)) { nsIFrame* kidNextInFlow; aKidFrame->GetNextInFlow(kidNextInFlow); @@ -1017,7 +1017,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext) } -nsIFrame::ReflowStatus +nsReflowStatus nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext) { if (nsnull!=mCaptionFrames) @@ -1029,7 +1029,7 @@ nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext) nsSize maxSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); nsReflowMetrics desiredSize; nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mCaptionFrames->ElementAt(captionIndex); - ReflowStatus status; + nsReflowStatus status; captionFrame->ResizeReflow(aPresContext, desiredSize, maxSize, &maxElementSize, status); if (mMinCaptionWidth=kidAvailSize.height) kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; + nsReflowMetrics desiredSize; + nsReflowStatus status; // Get top margin for this kid nsIStyleContext* kidSC; @@ -322,12 +322,12 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext, { if (nsnull!=pKidMaxElementSize) printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height, pKidMaxElementSize->width, pKidMaxElementSize->height); else printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height); } } @@ -372,7 +372,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext, prevKidFrame = kidFrame; // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); /* Rows should not create continuing frames for cells * unless they absolutely have to! @@ -380,7 +380,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext, * otherwise PushChildren and bail. */ // Special handling for incomplete children - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // XXX It's good to assume that we might still have room // even if the child didn't complete (floaters will want this) nsIFrame* kidNextInFlow; @@ -530,7 +530,7 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext, while (nsnull != nextInFlow) { nsReflowMetrics desiredSize; - ReflowStatus status; + nsReflowStatus status; // Get the next child nsIFrame* kidFrame = nextInFlow->mFirstChild; @@ -586,12 +586,12 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext, { if (nsnull!=pKidMaxElementSize) printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height, pKidMaxElementSize->width, pKidMaxElementSize->height); else printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height); } } @@ -646,8 +646,8 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext, prevLastContentIsComplete = mLastContentIsComplete; // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No the child isn't complete nsIFrame* kidNextInFlow; @@ -746,10 +746,10 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext, * * @param aPresContext presentation context to use * @param aState current inline state - * @return frComplete if all content has been mapped and frNotComplete + * @return NS_FRAME_COMPLETE if all content has been mapped and NS_FRAME_NOT_COMPLETE * if we should be continued */ -nsIFrame::ReflowStatus +nsReflowStatus nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, RowReflowState& aState, nsSize* aMaxElementSize) @@ -758,7 +758,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, VerifyLastIsComplete(); #endif nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; + nsReflowStatus result = 0; // not complete // If we have no children and we have a prev-in-flow then we need to pick // up where it left off. If we have children, e.g. we're being resized, then @@ -789,13 +789,13 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, // Get the next content object nsIContent* cell = mContent->ChildAt(kidIndex); if (nsnull == cell) { - result = frComplete; + result = NS_FRAME_COMPLETE; break; } // Make sure we still have room left if (aState.availSize.height <= 0) { - // Note: return status was set to frNotComplete above... + // Note: return status was set to NS_FRAME_NOT_COMPLETE above... NS_RELEASE(cell); // cell: REFCNT--(a) break; } @@ -826,7 +826,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, // Try to reflow the child into the available space. It might not // fit or might need continuing. nsReflowMetrics desiredSize; - ReflowStatus status; + nsReflowStatus status; if (NS_UNCONSTRAINEDSIZE == aState.availSize.width) { // Reflow the child into the available space @@ -854,12 +854,12 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, { if (nsnull!=pKidMaxElementSize) printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height, pKidMaxElementSize->width, pKidMaxElementSize->height); else printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n", - status==frComplete?"complete":"NOT complete", + NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete", desiredSize.width, desiredSize.height); } } @@ -900,7 +900,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext, kidIndex++; // Did the child complete? - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // If the child isn't complete then it means that we've used up // all of our available space mLastContentIsComplete = PR_FALSE; @@ -934,7 +934,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::ResizeReflow - aMaxSize = %d, %d\n", @@ -954,7 +954,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; // Check for an overflow list MoveOverflowToChildList(); @@ -966,7 +966,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, if (nsnull != mFirstChild) { reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } @@ -976,7 +976,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, if (state.availSize.height <= 0) { // No space left. Don't try to pull-up children or reflow unmapped if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } else if (NextChildOffset() < mContent->ChildCount()) { // Try and pull-up some children from a next-in-flow @@ -988,12 +988,12 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, } else { // We were unable to pull-up all the existing frames from the // next in flow - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } } - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { // Don't forget to add in the bottom margin from our last child. // Only add it in if there's room for it. nscoord margin = state.prevMaxPosBottomMargin - @@ -1012,12 +1012,12 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext, { if (nsnull!=aMaxElementSize) printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", aDesiredSize.width, aDesiredSize.height, aMaxElementSize->width, aMaxElementSize->height); else printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", aDesiredSize.width, aDesiredSize.height); } @@ -1030,10 +1030,10 @@ nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::IncrementalReflow\n"); - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/tables/nsTableRowFrame.h b/mozilla/layout/tables/nsTableRowFrame.h index e84cfb28d2f..8a7d1d53005 100644 --- a/mozilla/layout/tables/nsTableRowFrame.h +++ b/mozilla/layout/tables/nsTableRowFrame.h @@ -81,14 +81,14 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsIFrame::IncrementalReflow */ NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsContainerFrame::CreateContinuingFrame */ NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, @@ -159,9 +159,9 @@ protected: * @return frComplete if all content has been mapped and frNotComplete * if we should be continued */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - RowReflowState& aState, - nsSize* aMaxElementSize); + nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, + RowReflowState& aState, + nsSize* aMaxElementSize); private: diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index bc77cceed71..da6036a2a5d 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -270,8 +270,8 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon nsSize kidAvailSize(aState.availSize); if (0>=kidAvailSize.height) kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet - nsReflowMetrics desiredSize; - nsIFrame::ReflowStatus status; + nsReflowMetrics desiredSize; + nsReflowStatus status; // Get top margin for this kid nsIContentPtr kid; @@ -340,7 +340,7 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon prevKidFrame = kidFrame; // Update mLastContentIsComplete now that this kid fits - mLastContentIsComplete = PRBool(status == frComplete); + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); /* Row groups should not create continuing frames for rows * unless they absolutely have to! @@ -348,7 +348,7 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon * otherwise PushChildren and bail. */ // Special handling for incomplete children - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // XXX It's good to assume that we might still have room // even if the child didn't complete (floaters will want this) nsIFrame* kidNextInFlow; @@ -495,7 +495,7 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, while (nsnull != nextInFlow) { nsReflowMetrics kidSize; - ReflowStatus status; + nsReflowStatus status; // Get the next child nsIFrame* kidFrame = nextInFlow->mFirstChild; @@ -579,8 +579,8 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, prevLastContentIsComplete = mLastContentIsComplete; // Is the child we just pulled up complete? - mLastContentIsComplete = PRBool(status == frComplete); - if (frNotComplete == status) { + mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status); + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // No the child isn't complete nsIFrame* kidNextInFlow; @@ -682,7 +682,7 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, * @return frComplete if all content has been mapped and frNotComplete * if we should be continued */ -nsIFrame::ReflowStatus +nsReflowStatus nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, RowGroupReflowState& aState, nsSize* aMaxElementSize) @@ -690,8 +690,8 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, #ifdef NS_DEBUG VerifyLastIsComplete(); #endif - nsIFrame* kidPrevInFlow = nsnull; - ReflowStatus result = frNotComplete; + nsIFrame* kidPrevInFlow = nsnull; + nsReflowStatus result = 0; // not complete // If we have no children and we have a prev-in-flow then we need to pick // up where it left off. If we have children, e.g. we're being resized, then @@ -721,7 +721,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); if (kid.IsNull()) { - result = frComplete; + result = NS_FRAME_COMPLETE; break; } @@ -756,8 +756,8 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Try to reflow the child into the available space. It might not // fit or might need continuing. nsReflowMetrics kidSize; - ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, - aState.availSize, pKidMaxElementSize); + nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize, + aState.availSize, pKidMaxElementSize); // Did the child fit? if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) { @@ -788,7 +788,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, kidIndex++; // Did the child complete? - if (frNotComplete == status) { + if (NS_FRAME_IS_NOT_COMPLETE(status)) { // If the child isn't complete then it means that we've used up // all of our available space mLastContentIsComplete = PR_FALSE; @@ -820,7 +820,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug1==PR_TRUE) printf("nsTableRowGroupFrame::ResizeReflow - aMaxSize = %d, %d\n", @@ -837,7 +837,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, PRBool reflowMappedOK = PR_TRUE; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; // Check for an overflow list MoveOverflowToChildList(); @@ -848,7 +848,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, if (nsnull != mFirstChild) { reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize); if (PR_FALSE == reflowMappedOK) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } @@ -858,7 +858,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, if (state.availSize.height <= 0) { // No space left. Don't try to pull-up children or reflow unmapped if (NextChildOffset() < mContent->ChildCount()) { - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } else if (NextChildOffset() < mContent->ChildCount()) { // Try and pull-up some children from a next-in-flow @@ -870,12 +870,12 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, } else { // We were unable to pull-up all the existing frames from the // next in flow - aStatus = frNotComplete; + aStatus = NS_FRAME_NOT_COMPLETE; } } } - if (frComplete == aStatus) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { // Don't forget to add in the bottom margin from our last child. // Only add it in if there's room for it. nscoord margin = state.prevMaxPosBottomMargin - @@ -899,12 +899,12 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext, { if (nsnull!=aMaxElementSize) printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", aDesiredSize.width, aDesiredSize.height, aMaxElementSize->width, aMaxElementSize->height); else printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n", - aStatus==frComplete?"Complete":"Not Complete", + NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete", aDesiredSize.width, aDesiredSize.height); } @@ -917,7 +917,7 @@ nsTableRowGroupFrame::IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus) + nsReflowStatus& aStatus) { if (gsDebug1==PR_TRUE) printf("nsTableRowGroupFrame::IncrementalReflow\n"); @@ -925,7 +925,7 @@ nsTableRowGroupFrame::IncrementalReflow(nsIPresContext* aPresContext, aDesiredSize.width = aMaxSize.width; aDesiredSize.height = aMaxSize.height; - aStatus = frComplete; + aStatus = NS_FRAME_COMPLETE; return NS_OK; } diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.h b/mozilla/layout/tables/nsTableRowGroupFrame.h index 23edb9aca3c..04bb9d7d574 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.h +++ b/mozilla/layout/tables/nsTableRowGroupFrame.h @@ -76,13 +76,13 @@ public: nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsSize* aMaxElementSize, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsIFrame::IncrementalReflow */ NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext, nsReflowMetrics& aDesiredSize, const nsSize& aMaxSize, nsReflowCommand& aReflowCommand, - ReflowStatus& aStatus); + nsReflowStatus& aStatus); /** @see nsContainerFrame::CreateContinuingFrame */ NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext, @@ -152,9 +152,9 @@ protected: * @return frComplete if all content has been mapped and frNotComplete * if we should be continued */ - ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, - RowGroupReflowState& aState, - nsSize* aMaxElementSize); + nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext, + RowGroupReflowState& aState, + nsSize* aMaxElementSize); private: nsIAtom *mType;