From 7d546d74796d5f3cfa4d95fe0f529e24ef301aa0 Mon Sep 17 00:00:00 2001 From: kipp Date: Fri, 5 Jun 1998 00:54:03 +0000 Subject: [PATCH] Fixed to return proper reflow status git-svn-id: svn://10.0.0.236/trunk@3288 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsBlockFrame.cpp | 15 ++++++++++----- mozilla/layout/generic/nsBlockReflowState.cpp | 15 ++++++++++----- mozilla/layout/generic/nsBlockReflowState.h | 15 ++++++++++----- mozilla/layout/html/base/src/nsBlockFrame.cpp | 15 ++++++++++----- .../layout/html/base/src/nsBlockReflowState.cpp | 15 ++++++++++----- mozilla/layout/html/base/src/nsBlockReflowState.h | 15 ++++++++++----- 6 files changed, 60 insertions(+), 30 deletions(-) diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index b400e1e1f97..2c7262410e3 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -478,7 +478,6 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, nsReflowStatus& aStatus) { nsIRunaround* reflowRunaround; - nsReflowStatus status; NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state"); #ifdef NS_DEBUG @@ -565,7 +564,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, // Yes, the child frame wants to interact directly with the space // manager. reflowRunaround->Reflow(aPresContext, aSpaceManager, aDesiredSize, aReflowState, - aDesiredRect, status); + aDesiredRect, aStatus); } else { // No, use interface nsIFrame instead. if (aReflowState.maxSize.width != NS_UNCONSTRAINEDSIZE) { @@ -576,7 +575,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } // XXX FIX ME - aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, status); + aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); // Return the desired rect aDesiredRect.x = availBand.x; @@ -585,7 +584,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, aDesiredRect.height = aDesiredSize.height; } - if (NS_FRAME_IS_COMPLETE(status)) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsIFrame* kidNextInFlow; aKidFrame->GetNextInFlow(kidNextInFlow); @@ -599,7 +598,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } } - return status; + return NS_OK; } nsLineData* @@ -1541,6 +1540,12 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, } } +#ifdef NS_DEBUG + if (0 != mContent->ChildCount()) { + NS_ASSERTION(nsnull != mLines, "reflowed zero children"); + } +#endif + // Return our desired rect ComputeDesiredRect(state, aReflowState.maxSize, aDesiredRect); diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index b400e1e1f97..2c7262410e3 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -478,7 +478,6 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, nsReflowStatus& aStatus) { nsIRunaround* reflowRunaround; - nsReflowStatus status; NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state"); #ifdef NS_DEBUG @@ -565,7 +564,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, // Yes, the child frame wants to interact directly with the space // manager. reflowRunaround->Reflow(aPresContext, aSpaceManager, aDesiredSize, aReflowState, - aDesiredRect, status); + aDesiredRect, aStatus); } else { // No, use interface nsIFrame instead. if (aReflowState.maxSize.width != NS_UNCONSTRAINEDSIZE) { @@ -576,7 +575,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } // XXX FIX ME - aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, status); + aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); // Return the desired rect aDesiredRect.x = availBand.x; @@ -585,7 +584,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, aDesiredRect.height = aDesiredSize.height; } - if (NS_FRAME_IS_COMPLETE(status)) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsIFrame* kidNextInFlow; aKidFrame->GetNextInFlow(kidNextInFlow); @@ -599,7 +598,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } } - return status; + return NS_OK; } nsLineData* @@ -1541,6 +1540,12 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, } } +#ifdef NS_DEBUG + if (0 != mContent->ChildCount()) { + NS_ASSERTION(nsnull != mLines, "reflowed zero children"); + } +#endif + // Return our desired rect ComputeDesiredRect(state, aReflowState.maxSize, aDesiredRect); diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index b400e1e1f97..2c7262410e3 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -478,7 +478,6 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, nsReflowStatus& aStatus) { nsIRunaround* reflowRunaround; - nsReflowStatus status; NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state"); #ifdef NS_DEBUG @@ -565,7 +564,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, // Yes, the child frame wants to interact directly with the space // manager. reflowRunaround->Reflow(aPresContext, aSpaceManager, aDesiredSize, aReflowState, - aDesiredRect, status); + aDesiredRect, aStatus); } else { // No, use interface nsIFrame instead. if (aReflowState.maxSize.width != NS_UNCONSTRAINEDSIZE) { @@ -576,7 +575,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } // XXX FIX ME - aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, status); + aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); // Return the desired rect aDesiredRect.x = availBand.x; @@ -585,7 +584,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, aDesiredRect.height = aDesiredSize.height; } - if (NS_FRAME_IS_COMPLETE(status)) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsIFrame* kidNextInFlow; aKidFrame->GetNextInFlow(kidNextInFlow); @@ -599,7 +598,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } } - return status; + return NS_OK; } nsLineData* @@ -1541,6 +1540,12 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, } } +#ifdef NS_DEBUG + if (0 != mContent->ChildCount()) { + NS_ASSERTION(nsnull != mLines, "reflowed zero children"); + } +#endif + // Return our desired rect ComputeDesiredRect(state, aReflowState.maxSize, aDesiredRect); diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index b400e1e1f97..2c7262410e3 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -478,7 +478,6 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, nsReflowStatus& aStatus) { nsIRunaround* reflowRunaround; - nsReflowStatus status; NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state"); #ifdef NS_DEBUG @@ -565,7 +564,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, // Yes, the child frame wants to interact directly with the space // manager. reflowRunaround->Reflow(aPresContext, aSpaceManager, aDesiredSize, aReflowState, - aDesiredRect, status); + aDesiredRect, aStatus); } else { // No, use interface nsIFrame instead. if (aReflowState.maxSize.width != NS_UNCONSTRAINEDSIZE) { @@ -576,7 +575,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } // XXX FIX ME - aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, status); + aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); // Return the desired rect aDesiredRect.x = availBand.x; @@ -585,7 +584,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, aDesiredRect.height = aDesiredSize.height; } - if (NS_FRAME_IS_COMPLETE(status)) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsIFrame* kidNextInFlow; aKidFrame->GetNextInFlow(kidNextInFlow); @@ -599,7 +598,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } } - return status; + return NS_OK; } nsLineData* @@ -1541,6 +1540,12 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, } } +#ifdef NS_DEBUG + if (0 != mContent->ChildCount()) { + NS_ASSERTION(nsnull != mLines, "reflowed zero children"); + } +#endif + // Return our desired rect ComputeDesiredRect(state, aReflowState.maxSize, aDesiredRect); diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index b400e1e1f97..2c7262410e3 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -478,7 +478,6 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, nsReflowStatus& aStatus) { nsIRunaround* reflowRunaround; - nsReflowStatus status; NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state"); #ifdef NS_DEBUG @@ -565,7 +564,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, // Yes, the child frame wants to interact directly with the space // manager. reflowRunaround->Reflow(aPresContext, aSpaceManager, aDesiredSize, aReflowState, - aDesiredRect, status); + aDesiredRect, aStatus); } else { // No, use interface nsIFrame instead. if (aReflowState.maxSize.width != NS_UNCONSTRAINEDSIZE) { @@ -576,7 +575,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } // XXX FIX ME - aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, status); + aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); // Return the desired rect aDesiredRect.x = availBand.x; @@ -585,7 +584,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, aDesiredRect.height = aDesiredSize.height; } - if (NS_FRAME_IS_COMPLETE(status)) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsIFrame* kidNextInFlow; aKidFrame->GetNextInFlow(kidNextInFlow); @@ -599,7 +598,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } } - return status; + return NS_OK; } nsLineData* @@ -1541,6 +1540,12 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, } } +#ifdef NS_DEBUG + if (0 != mContent->ChildCount()) { + NS_ASSERTION(nsnull != mLines, "reflowed zero children"); + } +#endif + // Return our desired rect ComputeDesiredRect(state, aReflowState.maxSize, aDesiredRect); diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index b400e1e1f97..2c7262410e3 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -478,7 +478,6 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, nsReflowStatus& aStatus) { nsIRunaround* reflowRunaround; - nsReflowStatus status; NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state"); #ifdef NS_DEBUG @@ -565,7 +564,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, // Yes, the child frame wants to interact directly with the space // manager. reflowRunaround->Reflow(aPresContext, aSpaceManager, aDesiredSize, aReflowState, - aDesiredRect, status); + aDesiredRect, aStatus); } else { // No, use interface nsIFrame instead. if (aReflowState.maxSize.width != NS_UNCONSTRAINEDSIZE) { @@ -576,7 +575,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } // XXX FIX ME - aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, status); + aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); // Return the desired rect aDesiredRect.x = availBand.x; @@ -585,7 +584,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, aDesiredRect.height = aDesiredSize.height; } - if (NS_FRAME_IS_COMPLETE(status)) { + if (NS_FRAME_IS_COMPLETE(aStatus)) { nsIFrame* kidNextInFlow; aKidFrame->GetNextInFlow(kidNextInFlow); @@ -599,7 +598,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame, } } - return status; + return NS_OK; } nsLineData* @@ -1541,6 +1540,12 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, } } +#ifdef NS_DEBUG + if (0 != mContent->ChildCount()) { + NS_ASSERTION(nsnull != mLines, "reflowed zero children"); + } +#endif + // Return our desired rect ComputeDesiredRect(state, aReflowState.maxSize, aDesiredRect);