DrainOverflow();
NS_FRAME_TRACE_REFLOW_IN("nsInlineFrame::Reflow"); #ifdef NS_DEBUG if (GetVerifyTreeEnable()) { PreReflowCheck(); } #endif
nsInlineFrame::Reflow(nsIPresContext&          aPresContext,                      nsHTMLReflowMetrics&     aMetrics,                      const nsHTMLReflowState& aReflowState,                      nsReflowStatus&          aStatus){  DrainOverflow();  ReflowState rs(aPresContext, aReflowState, aMetrics,                 (nsInlineFrame*) mNextInFlow);  // Peel off the next frame in the path if this is an incremental  // reflow aimed at one of the children.  if (eReflowReason_Incremental == aReflowState.reason) {    nsIFrame* target;    rs.reflowCommand->GetTarget(target);    if (this != target) {      rs.reflowCommand->GetNext(rs.mNextRCFrame);    }  }  nsresult rv;  if (mFrames.IsEmpty()) {#ifdef HAVE_ANONYMOUS_BLOCK    NS_ASSERTION(!HaveAnonymousBlock(), "bad state");#endif    // Try to pull over one frame before starting so that we know what    // state the HAVE_ANONYMOUS_BLOCK flag should be in.    nsIFrame* frame = PullAnyFrame(rs);    if (nsnull != frame) {#ifdef HAVE_ANONYMOUS_BLOCK      if (nsLineLayout::TreatFrameAsBlock(frame)) {        mState |= HAVE_ANONYMOUS_BLOCK;      }#endif    }    else {      aStatus = NS_FRAME_COMPLETE;      aMetrics.width = 0;      aMetrics.height = 0;      aMetrics.ascent = 0;      aMetrics.descent = 0;      aMetrics.mCarriedOutTopMargin = 0;      aMetrics.mCarriedOutBottomMargin = 0;      aMetrics.mCombinedArea.SetRect(0, 0, 0, 0);      if (nsnull != aMetrics.maxElementSize) {        aMetrics.maxElementSize->SizeTo(0, 0);      }      return NS_OK;    }  }  if (HaveAnonymousBlock()) {    rv = ReflowBlockFrame(rs, aMetrics, aStatus);  }  else {    rv = ReflowInlineFrames(rs, aMetrics, aStatus);  }  if (NS_SUCCEEDED(rv)) {    // If the combined area of our children exceeds our bounding box    // then set the NS_FRAME_OUTSIDE_CHILDREN flag, otherwise clear it.    if ((aMetrics.mCombinedArea.x < 0) ||        (aMetrics.mCombinedArea.y < 0) ||        (aMetrics.mCombinedArea.XMost() > aMetrics.width) ||        (aMetrics.mCombinedArea.YMost() > aMetrics.height)) {      mState |= NS_FRAME_OUTSIDE_CHILDREN;    }    else {      mState &= ~NS_FRAME_OUTSIDE_CHILDREN;    }  }  return rv;}