nsBlockFrame::Reflow(nsIPresContext*      aPresContext, nsISpaceManager*     aSpaceManager, nsReflowMetrics&     aDesiredSize, const nsReflowState& aReflowState, nsRect&              aDesiredRect, nsReflowStatus&      aStatus)
BulletFrame::Reflow(nsIPresContext& aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus)
nsBlockFrame::Reflow(nsIPresContext*      aPresContext,                     nsISpaceManager*     aSpaceManager,                     nsReflowMetrics&     aDesiredSize,                     const nsReflowState& aReflowState,                     nsRect&              aDesiredRect,                     nsReflowStatus&      aStatus){#ifdef NS_DEBUG  if (GetVerifyTreeEnable()) {    VerifyLines(PR_TRUE);    PreReflowCheck();  }#endif  nsBlockReflowState state;  nsresult           rv = NS_OK;  if (eReflowReason_Initial == aReflowState.reason) {//XXX remove this code and uncomment the assertion when the table code plays nice#ifdef NS_DEBUG    if (0 == (NS_FRAME_FIRST_REFLOW & mState)) {      printf("XXX: table code isn't setting the reflow reason properly! [nsBlockFrame.cpp]\n");    }#endif//XXX    NS_ASSERTION(0 != (NS_FRAME_FIRST_REFLOW & mState), "bad mState");    rv = ProcessInitialReflow(aPresContext);    if (NS_OK != rv) {      return rv;    }  }  else {//XXX remove this code and uncomment the assertion when the table code plays nice#ifdef NS_DEBUG    if (0 != (NS_FRAME_FIRST_REFLOW & mState)) {      printf("XXX: table code isn't setting the reflow reason properly! [nsBlockFrame.cpp]\n");    }#endif//XXX    NS_ASSERTION(0 == (NS_FRAME_FIRST_REFLOW & mState), "bad mState");  }  aStatus = NS_FRAME_COMPLETE;  rv = InitializeState(aPresContext, aSpaceManager, aReflowState,                       aDesiredSize.maxElementSize, state);  NS_FRAME_TRACE_MSG(("enter nsBlockFrame::Reflow: reason=%d deltaWidth=%d",                      aReflowState.reason, state.mDeltaWidth));  if (eReflowReason_Incremental == aReflowState.reason) {    nsIPresShell* shell = state.mPresContext->GetShell();    shell->PutCachedData(this, &state);    // Is the reflow command target at us?    if (this == aReflowState.reflowCommand->GetTarget()) {      if (nsReflowCommand::FrameAppended == aReflowState.reflowCommand->GetType()) {        nsLineData* lastLine = LastLine();          // Restore the state        if (nsnull != lastLine) {          state.RecoverState(lastLine);        }          // Reflow unmapped children        PRInt32 kidIndex = NextChildOffset();        PRInt32 contentChildCount = mContent->ChildCount();        if (kidIndex == contentChildCount) {          // There is nothing to do here          if (nsnull != lastLine) {            state.mY = lastLine->mBounds.YMost();          }        }        else {          rv = ReflowUnmapped(state);        }      } else {        NS_NOTYETIMPLEMENTED("unexpected reflow command");      }   } else {      // The command is passing through us. Get the next frame in the      // reflow chain      nsIFrame* nextFrame = aReflowState.reflowCommand->GetNext();        // Restore our state as if nextFrame is the next frame to reflow      nsLineData* line = FindLine(nextFrame);      state.RecoverState(line);        // Get some available space to start reflowing with      GetAvailableSpace(state, state.mY);        // Reflow the affected line      nsLineLayout  lineLayout(state);        state.mCurrentLine = &lineLayout;      lineLayout.Initialize(state, line);        // Have the line handle the incremental reflow      nsRect  oldBounds = line->mBounds;      rv = lineLayout.IncrementalReflowFromChild(aReflowState.reflowCommand,                                                 nextFrame);        // Now place the line. It's possible it won't fit      rv = PlaceLine(state, lineLayout, line);      // XXX The way NS_LINE_LAYOUT_COMPLETE is being used is very confusing...      if (NS_LINE_LAYOUT_COMPLETE == rv) {        mLastContentOffset = line->mLastContentOffset;        mLastContentIsComplete = PRBool(line->mLastContentIsComplete);        state.mPrevKidFrame = lineLayout.mState.mPrevKidFrame;          // Now figure out what to do with the frames that follow        rv = IncrementalReflowAfter(state, line, rv, oldBounds);      }    }      // Return our desired rect    ComputeDesiredRect(state, aReflowState.maxSize, aDesiredRect);      // Set return status    aStatus = NS_FRAME_COMPLETE;    if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {      rv = NS_OK;      aStatus = NS_FRAME_NOT_COMPLETE;    }      // Now that reflow has finished, remove the cached pointer    shell->RemoveCachedData(this);    NS_RELEASE(shell);  } else {    nsresult rv = NS_OK;    nsIPresShell* shell = aPresContext->GetShell();    shell->PutCachedData(this, &state);    // Check for an overflow list    DrainOverflowList();    if (nsnull != mLines) {      rv = ReflowMapped(state);    }    if (NS_OK == rv) {      if ((nsnull != mLines) && (state.mAvailSize.height <= 0)) {        // We are out of space      }      if (MoreToReflow(state)) {        rv = ReflowUnmapped(state);      }    }    // Return our desired rect    ComputeDesiredRect(state, aReflowState.maxSize, aDesiredRect);    // Set return status    aStatus = NS_FRAME_COMPLETE;    if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {      rv = NS_OK;      aStatus = NS_FRAME_NOT_COMPLETE;    }    // Now that reflow has finished, remove the cached pointer    shell->RemoveCachedData(this);    NS_RELEASE(shell);  }#ifdef NS_DEBUG  if (GetVerifyTreeEnable()) {    VerifyLines(PR_TRUE);    PostReflowCheck(aStatus);  }#endif  NS_FRAME_TRACE_REFLOW_OUT("exit nsBlockFrame::Reflow", aStatus);  return rv;}