From 85898145c70ac1bc10a46b3cfeaa6ee087481b86 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Tue, 13 Apr 1999 02:55:54 +0000 Subject: [PATCH] Made things a little more efficient by now making a copy of the reflow state that's passed in, but instead casting the "const" away and setting the space manager directly git-svn-id: svn://10.0.0.236/trunk@27299 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsAreaFrame.cpp | 19 +++++++++---------- mozilla/layout/html/base/src/nsAreaFrame.cpp | 19 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/mozilla/layout/generic/nsAreaFrame.cpp b/mozilla/layout/generic/nsAreaFrame.cpp index 21dded2756e..df09770a7aa 100644 --- a/mozilla/layout/generic/nsAreaFrame.cpp +++ b/mozilla/layout/generic/nsAreaFrame.cpp @@ -388,30 +388,29 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext, } } - // Let the block frame code handle it. Make a copy of the reflow state so we can - // set the space manager. + // Set the space manager. // Note: we don't do this for absolutely positioned child frames, because they // have their own space manager - nsHTMLReflowState reflowState(aReflowState); - if (nsnull != mSpaceManager) { + // Modify the reflow state and set the space manager + nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState; reflowState.spaceManager = mSpaceManager; // Clear the spacemanager's regions. mSpaceManager->ClearRegions(); } - rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, reflowState, aStatus); + rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); // Reflow the absolutely positioned child frames. We need to do this even for // an incremental reflow, because some of the absolutely positioned child frames // may have 'auto' for an offset - ReflowAbsoluteFrames(aPresContext, reflowState); + ReflowAbsoluteFrames(aPresContext, aReflowState); - // Compute our desired size taking into account anything that sticks - // outside our new size (for example, floaters). Note that if this - // frame has a height specified by CSS then we don't do this! - if ((NS_UNCONSTRAINEDSIZE == reflowState.computedHeight) && + // Compute our desired size taking into account floaters that stick outside + // our box. Note that if this frame has a height specified by CSS then we + // don't do this + if ((NS_UNCONSTRAINEDSIZE == aReflowState.computedHeight) && (NS_FRAME_OUTSIDE_CHILDREN & mState)) { nscoord contentYMost = aDesiredSize.height; nscoord yMost = aDesiredSize.mCombinedArea.YMost(); diff --git a/mozilla/layout/html/base/src/nsAreaFrame.cpp b/mozilla/layout/html/base/src/nsAreaFrame.cpp index 21dded2756e..df09770a7aa 100644 --- a/mozilla/layout/html/base/src/nsAreaFrame.cpp +++ b/mozilla/layout/html/base/src/nsAreaFrame.cpp @@ -388,30 +388,29 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext, } } - // Let the block frame code handle it. Make a copy of the reflow state so we can - // set the space manager. + // Set the space manager. // Note: we don't do this for absolutely positioned child frames, because they // have their own space manager - nsHTMLReflowState reflowState(aReflowState); - if (nsnull != mSpaceManager) { + // Modify the reflow state and set the space manager + nsHTMLReflowState& reflowState = (nsHTMLReflowState&)aReflowState; reflowState.spaceManager = mSpaceManager; // Clear the spacemanager's regions. mSpaceManager->ClearRegions(); } - rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, reflowState, aStatus); + rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); // Reflow the absolutely positioned child frames. We need to do this even for // an incremental reflow, because some of the absolutely positioned child frames // may have 'auto' for an offset - ReflowAbsoluteFrames(aPresContext, reflowState); + ReflowAbsoluteFrames(aPresContext, aReflowState); - // Compute our desired size taking into account anything that sticks - // outside our new size (for example, floaters). Note that if this - // frame has a height specified by CSS then we don't do this! - if ((NS_UNCONSTRAINEDSIZE == reflowState.computedHeight) && + // Compute our desired size taking into account floaters that stick outside + // our box. Note that if this frame has a height specified by CSS then we + // don't do this + if ((NS_UNCONSTRAINEDSIZE == aReflowState.computedHeight) && (NS_FRAME_OUTSIDE_CHILDREN & mState)) { nscoord contentYMost = aDesiredSize.height; nscoord yMost = aDesiredSize.mCombinedArea.YMost();