예제 #1
0
NS_IMETHODIMP
nsFieldSetFrame::RemoveFrame(nsIAtom*       aListName,
                             nsIFrame*      aOldFrame)
{
  // For reference, see bug 70648, bug 276104 and bug 236071.
  if (aOldFrame == mLegendFrame) {
    NS_ASSERTION(!aListName, "Unexpected frame list when removing legend frame");
    NS_ASSERTION(mLegendFrame->GetParent() == this, "Legend Parent has wrong parent");
    NS_ASSERTION(mLegendFrame->GetNextSibling() == mContentFrame, "mContentFrame is not next sibling");
    nsPresContext* presContext = GetPresContext();
    mFrames.DestroyFrame(presContext, mLegendFrame);
    mLegendFrame = nsnull;
    AddStateBits(NS_FRAME_IS_DIRTY);
    if (GetParent()) {
      GetParent()->ReflowDirtyChild(presContext->GetPresShell(), this);
    }
    return NS_OK;
  }
  return mContentFrame->RemoveFrame(aListName, aOldFrame);
}