aMetrics.width = bounds.width; aMetrics.height = bounds.height; aMetrics.ascent = bounds.height;
aStatus = NS_INLINE_LINE_BREAK_AFTER(complete);     aMetrics.width = 0; aMetrics.height = 0; aMetrics.ascent = 0;
nsInlineFrame::ReflowBlockFrame(nsIPresContext& aPresContext,                                const nsHTMLReflowState& aReflowState,                                InlineReflowState& irs,                                nsHTMLReflowMetrics& aMetrics,                                nsReflowStatus& aStatus){  nsIFrame* blockFrame = mFrames.FirstChild();  // Compute available area  nscoord x = aReflowState.mComputedBorderPadding.left;  nscoord availableWidth = aReflowState.availableWidth;  if (NS_UNCONSTRAINEDSIZE != availableWidth) {    if (nsnull != mPrevInFlow) {      x = 0;      availableWidth -= aReflowState.mComputedBorderPadding.right;    }    else {      availableWidth -= aReflowState.mComputedBorderPadding.left +        aReflowState.mComputedBorderPadding.right;    }  }  nscoord y = aReflowState.mComputedBorderPadding.top;  nscoord availableHeight = aReflowState.availableHeight;  if (NS_UNCONSTRAINEDSIZE != aReflowState.availableHeight) {    availableHeight -= aReflowState.mComputedBorderPadding.top +      aReflowState.mComputedBorderPadding.right;  }  // Reflow the block frame  nsBlockReflowContext bc(aPresContext, aReflowState,                          nsnull != aMetrics.maxElementSize);  bc.SetNextRCFrame(irs.mNextRCFrame);  nsRect availSpace(x, y, availableWidth, availableHeight);  PRBool isAdjacentWithTop = PR_FALSE;  nsMargin computedOffsets;  nsresult rv = bc.ReflowBlock(blockFrame, availSpace,#ifdef SPECULATIVE_TOP_MARGIN                               PR_FALSE, 0,#endif                               isAdjacentWithTop,                               computedOffsets, aStatus);  if (NS_FAILED(rv)) {    return rv;  }  if (NS_INLINE_IS_BREAK_BEFORE(aStatus)) {    // We need to break before placing the block so propogate that    // status outward to our parent.  }  else {    // Place the block (during placement we might discover that none    // of it fits)    nsRect bounds;    PRBool anyFit = bc.PlaceBlock(isAdjacentWithTop,#ifndef SPECULATIVE_TOP_MARGIN                                  PR_FALSE, 0,#endif                                  computedOffsets,                                  bounds, aMetrics.mCombinedArea);    if (!anyFit) {      // None of the block fit      aStatus = NS_INLINE_LINE_BREAK_BEFORE();    }    else {      if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {        // When the block isn't complete create a continuation for it        nsIFrame* newFrame;        rv = CreateNextInFlow(aPresContext, this, blockFrame, newFrame);        if (NS_FAILED(rv)) {          return rv;        }      }      // It's possible that the block frame is followed by one or more      // inline frames. Make sure we reflect that in our reflow status      // and push them to our next-in-flow.      nsIFrame* nextFrame;      blockFrame->GetNextSibling(&nextFrame);      if (nsnull != nextFrame) {        PushFrames(nextFrame, blockFrame);        aStatus |= NS_FRAME_NOT_COMPLETE;      }      else if (NS_FRAME_IS_COMPLETE(aStatus)) {        // When the block we reflowed is complete then we need to        // check and see if there are other frames (inline frames)        // following in our continuations so that we return the proper        // reflow status.        nsInlineFrame* nextInFlow = (nsInlineFrame*) mNextInFlow;        while (nsnull != nextInFlow) {          if (nextInFlow->mFrames.NotEmpty() ||              nextInFlow->mOverflowFrames.NotEmpty()) {            aStatus |= NS_FRAME_NOT_COMPLETE;            break;          }          nextInFlow = (nsInlineFrame*) nextInFlow->mNextInFlow;        }      }      // XXX factor in border/padding      aMetrics.width = bounds.width;      aMetrics.height = bounds.height;      aMetrics.ascent = bounds.height;      aMetrics.descent = 0;      aMetrics.mCarriedOutTopMargin = bc.GetCollapsedTopMargin();      aMetrics.mCarriedOutBottomMargin = bc.GetCarriedOutBottomMargin();      if (nsnull != aMetrics.maxElementSize) {        *aMetrics.maxElementSize = bc.GetMaxElementSize();      }    }  }  return NS_OK;}