nsInlineFrame::RemoveFrame(nsIAtom*        aListName, nsIFrame*       aOldFrame)
nsInlineFrame::RemoveFrame(nsIPresContext& aPresContext, nsIPresShell& aPresShell, nsIAtom* aListName, nsIFrame* aOldFrame)
nsInlineFrame::RemoveFrame(nsIAtom*        aListName,                           nsIFrame*       aOldFrame){  if (nsnull != aListName) {#ifdef IBMBIDI    if (nsLayoutAtoms::nextBidi != aListName)#endif    return NS_ERROR_INVALID_ARG;  }  if (aOldFrame) {    // Loop and destroy the frame and all of its continuations.    // If the frame we are removing is a brFrame, we need a reflow so    // the line the brFrame was on can attempt to pull up any frames    // that can fit from lines below it.    PRBool generateReflowCommand =      aOldFrame->GetType() == nsLayoutAtoms::brFrame;    nsInlineFrame* parent = NS_STATIC_CAST(nsInlineFrame*, aOldFrame->GetParent());    while (aOldFrame) {#ifdef IBMBIDI      if (nsLayoutAtoms::nextBidi != aListName) {#endif      // If the frame being removed has zero size then don't bother      // generating a reflow command, otherwise make sure we do.      nsRect bbox = aOldFrame->GetRect();      if (bbox.width || bbox.height) {        generateReflowCommand = PR_TRUE;      }#ifdef IBMBIDI      }#endif      // When the parent is an inline frame we have a simple task - just      // remove the frame from its parents list and generate a reflow      // command.      nsIFrame* oldFrameNextInFlow = aOldFrame->GetNextInFlow();      parent->mFrames.DestroyFrame(GetPresContext(), aOldFrame);      aOldFrame = oldFrameNextInFlow;      if (aOldFrame) {        parent = NS_STATIC_CAST(nsInlineFrame*, aOldFrame->GetParent());      }    }    if (generateReflowCommand) {      // Ask the parent frame to reflow me.      ReflowDirtyChild(GetPresContext()->PresShell(), nsnull);    }  }  return NS_OK;}