DeleteChildsNextInFlow(aPresContext, kid);
DeleteNextInFlowChild(aPresContext, kidNextInFlow);
nsFirstLetterFrame::Reflow(nsIPresContext*          aPresContext,                           nsHTMLReflowMetrics&     aMetrics,                           const nsHTMLReflowState& aReflowState,                           nsReflowStatus&          aReflowStatus){  DO_GLOBAL_REFLOW_COUNT("nsFirstLetterFrame", aReflowState.reason);  DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aReflowStatus);  nsresult rv = NS_OK;  // Grab overflow list  DrainOverflowFrames(aPresContext);  nsIFrame* kid = mFrames.FirstChild();  // Setup reflow state for our child  nsSize availSize(aReflowState.availableWidth, aReflowState.availableHeight);  const nsMargin& bp = aReflowState.mComputedBorderPadding;  nscoord lr = bp.left + bp.right;  nscoord tb = bp.top + bp.bottom;  if (NS_UNCONSTRAINEDSIZE != availSize.width) {    availSize.width -= lr;  }  if (NS_UNCONSTRAINEDSIZE != availSize.height) {    availSize.height -= tb;  }  // Reflow the child  if (!aReflowState.mLineLayout) {    // When there is no lineLayout provided, we provide our own. The    // only time that the first-letter-frame is not reflowing in a    // line context is when its floating.    nsHTMLReflowState rs(aPresContext, aReflowState, kid, availSize);    nsLineLayout ll(aPresContext, nsnull, &aReflowState,                    nsnull != aMetrics.maxElementSize);    ll.BeginLineReflow(0, 0, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE,                       PR_FALSE, PR_TRUE);    rs.mLineLayout = &ll;    ll.SetFirstLetterStyleOK(PR_TRUE);    kid->WillReflow(aPresContext);    kid->Reflow(aPresContext, aMetrics, rs, aReflowStatus);    ll.EndLineReflow();  }  else {    // Pretend we are a span and reflow the child frame    nsLineLayout* ll = aReflowState.mLineLayout;    PRBool        pushedFrame;    ll->BeginSpan(this, &aReflowState, bp.left, availSize.width);    ll->ReflowFrame(kid, aReflowStatus, &aMetrics, pushedFrame);    nsSize size;    ll->EndSpan(this, size, aMetrics.maxElementSize);  }  // Place and size the child and update the output metrics  kid->MoveTo(aPresContext, bp.left, bp.top);  kid->SizeTo(aPresContext, aMetrics.width, aMetrics.height);  kid->DidReflow(aPresContext, nsnull, NS_FRAME_REFLOW_FINISHED);  aMetrics.width += lr;  aMetrics.height += tb;  aMetrics.ascent += bp.top;  aMetrics.descent += bp.bottom;  if (aMetrics.maxElementSize) {    aMetrics.maxElementSize->width += lr;    aMetrics.maxElementSize->height += tb;  }  // Create a continuation or remove existing continuations based on  // the reflow completion status.  if (NS_FRAME_IS_COMPLETE(aReflowStatus)) {    nsIFrame* kidNextInFlow;    kid->GetNextInFlow(&kidNextInFlow);    if (nsnull != kidNextInFlow) {      // Remove all of the childs next-in-flows      DeleteChildsNextInFlow(aPresContext, kid);    }  }  else {    // Create a continuation for the child frame if it doesn't already    // have one.    nsIFrame* nextInFlow;    rv = CreateNextInFlow(aPresContext, this, kid, nextInFlow);    if (NS_FAILED(rv)) {      return rv;    }    // And then push it to our overflow list    if (nextInFlow) {      kid->SetNextSibling(nsnull);      SetOverflowFrames(aPresContext, nextInFlow);    }    else {      nsIFrame* nextSib;      kid->GetNextSibling(&nextSib);      if (nextSib) {        kid->SetNextSibling(nsnull);        SetOverflowFrames(aPresContext, nextSib);      }    }  }  NS_FRAME_SET_TRUNCATION(aReflowStatus, aReflowState, aMetrics);  return rv;}