return nsHTMLContainerFrame::SetInitialChildList(aPresContext, nsnull, newChildList); #else  const nsStyleDisplay* styleDisplay; GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);  PRUint32 flags = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay) ? NS_BLOCK_SHRINK_WRAP : 0;   PRUint32 parentState; GetFrameState( &parentState ); flags |= parentState;  nsCOMPtr<nsIPresShell> shell; aPresContext->GetShell(getter_AddRefs(shell)); NS_NewAreaFrame(shell, &mContentFrame, flags); mFrames.SetFrames(mContentFrame);   nsIStyleContext* styleContext; aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::fieldsetContentPseudo, mStyleContext, PR_FALSE, &styleContext); mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull); mFrames.FirstChild()->SetNextSibling(nsnull); NS_RELEASE(styleContext);  nsIFrame* newChildList = aChildList;     nsIFrame* lastNewFrame = nsnull; for (nsIFrame* frame = aChildList; nsnull != frame;) { nsIFrame* legendFrame = nsnull; nsresult result = frame->QueryInterface(kLegendFrameCID, (void**)&legendFrame); if (NS_SUCCEEDED(result) && legendFrame) { if (mLegendFrame) { frame->GetNextSibling(&frame); if (lastNewFrame) { lastNewFrame->SetNextSibling(frame); } else { aChildList = frame; } legendFrame->Destroy(aPresContext); } else { nsIFrame* nextFrame; frame->GetNextSibling(&nextFrame); if (lastNewFrame) { lastNewFrame->SetNextSibling(nextFrame); } else { newChildList = nextFrame; } frame->SetParent(this); mFrames.FirstChild()->SetNextSibling(frame); mLegendFrame = frame; mLegendFrame->SetNextSibling(nsnull); frame = nextFrame; } } else { frame->SetParent(mFrames.FirstChild()); lastNewFrame = frame; frame->GetNextSibling(&frame); } }  return mFrames.FirstChild()->SetInitialChildList(aPresContext, nsnull, newChildList);  #endif
return nsHTMLContainerFrame::SetInitialChildList(aPresContext, nsnull, aChildList);
nsFieldSetFrame::SetInitialChildList(nsIPresContext* aPresContext,                                     nsIAtom*        aListName,                                     nsIFrame*       aChildList){#ifdef DO_NEWFIELDSET  nsIFrame* newChildList = aChildList;  // Set the geometric and content parent for each of the child frames   // that will go into the area frame's child list.  // The legend frame does not go into the list  nsIFrame* lastNewFrame = nsnull;  for (nsIFrame* frame = aChildList; nsnull != frame;) {    nsIFrame* legendFrame = nsnull;    nsresult result = frame->QueryInterface(kLegendFrameCID, (void**)&legendFrame);    if (NS_SUCCEEDED(result) && legendFrame) {      if (mLegendFrame) { // we already have a legend, destroy it        frame->GetNextSibling(&frame);        if (lastNewFrame) {          lastNewFrame->SetNextSibling(frame);        }         else {          aChildList = frame;        }        legendFrame->Destroy(aPresContext);      } else {        /*nsIFrame* nextFrame;        frame->GetNextSibling(&nextFrame);        if (lastNewFrame) {          lastNewFrame->SetNextSibling(nextFrame);        } else {          newChildList = nextFrame;        }        mFrames.FirstChild()->SetNextSibling(frame);        */        mLegendFrame = frame;        break;        //mLegendFrame->SetNextSibling(nsnull);        //frame = nextFrame;      }    } else {      lastNewFrame = frame;      frame->GetNextSibling(&frame);    }  }  // Queue up the frames for the content frame  return nsHTMLContainerFrame::SetInitialChildList(aPresContext, nsnull, newChildList);#else  // cache our display type  const nsStyleDisplay* styleDisplay;  GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);    PRUint32 flags = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay) ? NS_BLOCK_SHRINK_WRAP : 0;  // add in the parent state (we need it to be inherited)  PRUint32 parentState;  GetFrameState( &parentState );  flags |= parentState;  nsCOMPtr<nsIPresShell> shell;  aPresContext->GetShell(getter_AddRefs(shell));  NS_NewAreaFrame(shell, &mContentFrame, flags);  mFrames.SetFrames(mContentFrame);  // Resolve style and initialize the frame  nsIStyleContext* styleContext;  aPresContext->ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::fieldsetContentPseudo,                                            mStyleContext, PR_FALSE, &styleContext);  mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);  mFrames.FirstChild()->SetNextSibling(nsnull);  NS_RELEASE(styleContext);                                             nsIFrame* newChildList = aChildList;  // Set the geometric and content parent for each of the child frames   // that will go into the area frame's child list.  // The legend frame does not go into the list  nsIFrame* lastNewFrame = nsnull;  for (nsIFrame* frame = aChildList; nsnull != frame;) {    nsIFrame* legendFrame = nsnull;    nsresult result = frame->QueryInterface(kLegendFrameCID, (void**)&legendFrame);    if (NS_SUCCEEDED(result) && legendFrame) {      if (mLegendFrame) { // we already have a legend, destroy it        frame->GetNextSibling(&frame);        if (lastNewFrame) {          lastNewFrame->SetNextSibling(frame);        }         else {          aChildList = frame;        }        legendFrame->Destroy(aPresContext);      }       else {        nsIFrame* nextFrame;        frame->GetNextSibling(&nextFrame);        if (lastNewFrame) {          lastNewFrame->SetNextSibling(nextFrame);        } else {          newChildList = nextFrame;        }        frame->SetParent(this);        mFrames.FirstChild()->SetNextSibling(frame);        mLegendFrame = frame;        mLegendFrame->SetNextSibling(nsnull);        frame = nextFrame;      }    } else {      frame->SetParent(mFrames.FirstChild());      lastNewFrame = frame;      frame->GetNextSibling(&frame);    }  }  // Queue up the frames for the content frame  return mFrames.FirstChild()->SetInitialChildList(aPresContext, nsnull, newChildList);#endif}