WillReflowFrame(aState, aLine, aFrame);    PRBool reflowingFirstLetter = aState.mLineLayout->GetFirstLetterStyleOK();   nsReflowStatus frameReflowStatus; nsresult rv = aState.mInlineReflow->ReflowFrame(aFrame, aState.IsAdjacentWithTop(), frameReflowStatus); if (NS_FAILED(rv)) { return rv;
if (!aState.mInlineReflowPrepared) { PrepareInlineReflow(aState, aFrame, PR_FALSE);
nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,                                nsLineBox* aLine,                                nsIFrame* aFrame,                                PRBool* aKeepLineGoing){  NS_PRECONDITION(*aKeepLineGoing, "bad caller");  // Send pre-reflow notification  WillReflowFrame(aState, aLine, aFrame);  // If it's currently ok to be reflowing in first-letter style then  // we must be about to reflow a frame that has first-letter style.  PRBool reflowingFirstLetter = aState.mLineLayout->GetFirstLetterStyleOK();  // Reflow the inline frame  nsReflowStatus frameReflowStatus;  nsresult rv = aState.mInlineReflow->ReflowFrame(aFrame, aState.IsAdjacentWithTop(),                                                  frameReflowStatus);  if (NS_FAILED(rv)) {    return rv;  }#if defined(REFLOW_STATUS_COVERAGE)  RecordReflowStatus(PR_FALSE, frameReflowStatus);#endif  // Send post-reflow notification  aState.mPrevChild = aFrame;  // Process the child frames reflow status. There are 5 cases:  // complete, not-complete, break-before, break-after-complete,  // break-after-not-complete. There are two situations: we are a  // block or we are an inline. This makes a total of 10 cases  // (fortunately, there is some overlap).  aLine->mBreakType = NS_STYLE_CLEAR_NONE;  if (NS_INLINE_IS_BREAK(frameReflowStatus)) {    // Always abort the line reflow (because a line break is the    // minimal amount of break we do).    *aKeepLineGoing = PR_FALSE;    // XXX what should aLine->mBreakType be set to in all these cases?    PRUint8 breakType = NS_INLINE_GET_BREAK_TYPE(frameReflowStatus);    NS_ASSERTION(breakType != NS_STYLE_CLEAR_NONE, "bad break type");    NS_ASSERTION(NS_STYLE_CLEAR_PAGE != breakType, "no page breaks yet");    if (NS_INLINE_IS_BREAK_BEFORE(frameReflowStatus)) {      // Break-before cases.      if (aFrame == aLine->mFirstChild) {        NS_NOTREACHED("can't get here, can we?");#if 0        // All break-before's that occur at the first child on a        // line stop the overall reflow.        if (mLines == aLine) {          // If it's our first child on our first line then propogate          // outward the break-before reflow status unmodified.          aState.mReflowStatus = frameReflowStatus;        }        else {          // Its not our first line; push the remaining lines to a          // next-in-flow          PushLines(aState);          // Adjust the reflow status to indicate a          // break-after-not-complete; because we need to be continued          // and we need to force a line break (or something stronger)          // upstream.          aState.mReflowStatus = NS_FRAME_NOT_COMPLETE | NS_INLINE_BREAK |            NS_INLINE_BREAK_AFTER | NS_INLINE_MAKE_BREAK_TYPE(breakType);        }#endif      }      else {        // It's not the first child on this line so go ahead and split        // the line. We will see the frame again on the next-line.        rv = SplitLine(aState, aLine, aFrame);        if (NS_FAILED(rv)) {          return rv;        }      }    }    else {      // Break-after cases      aLine->mBreakType = breakType;      if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {        // Create a continuation for the incomplete frame. Note that the        // frame may already have a continuation.        PRBool madeContinuation;        rv = CreateContinuationFor(aState, aLine, aFrame, madeContinuation);        if (NS_FAILED(rv)) {          return rv;        }      }      // Split line, but after the frame just reflowed      aFrame->GetNextSibling(&aFrame);      rv = SplitLine(aState, aLine, aFrame);      if (NS_FAILED(rv)) {        return rv;      }      // Mark next line dirty in case SplitLine didn't end up      // pushing any frames.      nsLineBox* next = aLine->mNext;      if ((nsnull != next) && !next->IsBlock()) {        next->MarkDirty();      }    }  }  else if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {    // Frame is not-complete, no special breaking status    // Create a continuation for the incomplete frame. Note that the    // frame may already have a continuation.    PRBool madeContinuation;    rv = CreateContinuationFor(aState, aLine, aFrame, madeContinuation);    if (NS_FAILED(rv)) {      return rv;    }    PRBool needSplit = PR_FALSE;    if (!reflowingFirstLetter) {      needSplit = PR_TRUE;    }    if (needSplit) {      // Split line after the current frame      *aKeepLineGoing = PR_FALSE;      aFrame->GetNextSibling(&aFrame);      rv = SplitLine(aState, aLine, aFrame);      if (NS_FAILED(rv)) {        return rv;      }      // Mark next line dirty in case SplitLine didn't end up      // pushing any frames.      nsLineBox* next = aLine->mNext;      if ((nsnull != next) && !next->IsBlock()) {        next->MarkDirty();      }    }  }  return NS_OK;}