nsIFrame* insertionPoint = nsnull; nsCOMPtr<nsIContent> child; aOldFrame->GetContent(getter_AddRefs(child)); GetInsertionPoint(&aPresShell, aParentFrame, child, &insertionPoint); if (insertionPoint && (insertionPoint != aParentFrame)) return insertionPoint->RemoveFrame(aPresContext, aPresShell, aListName, aOldFrame);
FrameManager::RemoveFrame(nsIPresContext* aPresContext,                          nsIPresShell&   aPresShell,                          nsIFrame*       aParentFrame,                          nsIAtom*        aListName,                          nsIFrame*       aOldFrame){  NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);  nsIFrame* insertionPoint = nsnull;  nsCOMPtr<nsIContent> child;  aOldFrame->GetContent(getter_AddRefs(child));  GetInsertionPoint(&aPresShell, aParentFrame, child, &insertionPoint);  if (insertionPoint && (insertionPoint != aParentFrame))    return insertionPoint->RemoveFrame(aPresContext, aPresShell, aListName, aOldFrame);#ifdef IBMBIDI  // Don't let the parent remove next bidi. In the other cases the it should NOT be removed.  nsIFrame* nextBidi;  GetFrameProperty(aOldFrame, nsLayoutAtoms::nextBidi, 0, (void**) &nextBidi);  if (nextBidi) {    RemoveFrame(aPresContext, aPresShell, aParentFrame, aListName, nextBidi);  }#endif // IBMBIDI  return aParentFrame->RemoveFrame(aPresContext, aPresShell, aListName,                                   aOldFrame);}