aLine->SetBreakType(breakType); if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {   PRBool madeContinuation; rv = CreateContinuationFor(aState, aLine, aFrame, madeContinuation); if (NS_FAILED(rv)) { return rv; } }   nsIFrame* nextFrame; aFrame->GetNextSibling(&nextFrame); rv = SplitLine(aState, aLineLayout, aLine, nextFrame); if (NS_FAILED(rv)) { return rv; }    nsLineBox* next = aLine->mNext; if ((nsnull != next) && !next->IsBlock()) { next->MarkDirty(); } } } else if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {     PRBool madeContinuation; rv = CreateContinuationFor(aState, aLine, aFrame, madeContinuation); if (NS_FAILED(rv)) { return rv; }    PRBool splitLine = !reflowingFirstLetter; if (reflowingFirstLetter) { #ifdef BLOCK_DOES_FIRST_LINE if (aLine->IsFirstLine()) { splitLine = PR_TRUE; } else #endif { nsIAtom* frameType; if (NS_SUCCEEDED(aFrame->GetFrameType(&frameType)) && frameType) { if (frameType == nsLayoutAtoms::inlineFrame) { splitLine = PR_TRUE; } NS_RELEASE(frameType); } } }  if (splitLine) {  *aLineReflowStatus = LINE_REFLOW_STOP; aFrame->GetNextSibling(&aFrame); rv = SplitLine(aState, aLineLayout, aLine, aFrame); if (NS_FAILED(rv)) { return rv; }    nsLineBox* next = aLine->mNext; if ((nsnull != next) && !next->IsBlock()) { next->MarkDirty(); }
NS_ASSERTION(aLine->GetLastContentIsComplete(), "bad mState");
nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,                                nsLineLayout& aLineLayout,                                nsLineBox* aLine,                                nsIFrame* aFrame,                                PRUint8* aLineReflowStatus){  *aLineReflowStatus = LINE_REFLOW_OK;  // 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 = aLineLayout.GetFirstLetterStyleOK();#ifdef NOISY_FIRST_LETTER  ListTag(stdout);  printf(": reflowing ");  nsFrame::ListTag(stdout, aFrame);  printf(" reflowingFirstLetter=%s\n", reflowingFirstLetter ? "on" : "off");#endif  // Reflow the inline frame  nsReflowStatus frameReflowStatus;  nsresult rv = aLineLayout.ReflowFrame(aFrame, &aState.mNextRCFrame,                                        frameReflowStatus);  if (NS_FAILED(rv)) {    return rv;  }#ifdef REALLY_NOISY_REFLOW_CHILD  nsFrame::ListTag(stdout, aFrame);  printf(": status=%x\n", frameReflowStatus);#endif#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->SetBreakType(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).    *aLineReflowStatus = LINE_REFLOW_STOP;    // XXX what should aLine's break-type 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) {        // If we break before the first frame on the line then we must        // be trying to place content where theres no room (e.g. on a        // line with wide floaters). Inform the caller to reflow the        // line after skipping past a floater.        *aLineReflowStatus = LINE_REFLOW_REDO;      }      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, aLineLayout, aLine, aFrame);        if (NS_FAILED(rv)) {          return rv;        }      }    }    else {      // Break-after cases      aLine->SetBreakType(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      nsIFrame* nextFrame;      aFrame->GetNextSibling(&nextFrame);      rv = SplitLine(aState, aLineLayout, aLine, nextFrame);      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;    }    // If we are reflowing the first letter frame then don't split the    // line and don't stop the line reflow...    PRBool splitLine = !reflowingFirstLetter;    if (reflowingFirstLetter) {#ifdef BLOCK_DOES_FIRST_LINE      if (aLine->IsFirstLine()) {        splitLine = PR_TRUE;      }      else#endif      {        nsIAtom* frameType;        if (NS_SUCCEEDED(aFrame->GetFrameType(&frameType)) && frameType) {          if (frameType == nsLayoutAtoms::inlineFrame) {            splitLine = PR_TRUE;          }          NS_RELEASE(frameType);        }      }    }    if (splitLine) {      // Split line after the current frame      *aLineReflowStatus = LINE_REFLOW_STOP;      aFrame->GetNextSibling(&aFrame);      rv = SplitLine(aState, aLineLayout, 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;}