aFrame->GetAdditionalChildListName(childListIndex++, getter_AddRefs(childListName));
childListName = aFrame->GetAdditionalChildListName(childListIndex++);
DoDeletingFrameSubtree(nsIPresContext*  aPresContext,                       nsIPresShell*    aPresShell,                       nsIFrameManager* aFrameManager,                       nsVoidArray&     aDestroyQueue,                       nsIFrame*        aRemovedFrame,                       nsIFrame*        aFrame){  NS_PRECONDITION(aFrameManager, "no frame manager");  // Remove the mapping from the content object to its frame  nsIContent* content = aFrame->GetContent();  if (content) {    aFrameManager->SetPrimaryFrameFor(content, nsnull);    aFrame->RemovedAsPrimaryFrame(aPresContext);    aFrameManager->ClearAllUndisplayedContentIn(content);  }  // Walk aFrame's child frames  nsCOMPtr<nsIAtom> childListName;  PRInt32 childListIndex = 0;  do {    // Walk aFrame's child frames looking for placeholder frames    nsIFrame* childFrame;    aFrame->FirstChild(aPresContext, childListName, &childFrame);    while (childFrame) {      // The subtree we need to follow to get to the children; by      // default, the childFrame.      nsIFrame* subtree = childFrame;      // See if it's a placeholder frame      if (nsLayoutAtoms::placeholderFrame == childFrame->GetType()) {        // Get the out-of-flow frame        nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)childFrame)->GetOutOfFlowFrame();        NS_ASSERTION(outOfFlowFrame, "no out-of-flow frame");          // Remove the mapping from the out-of-flow frame to its placeholder        aFrameManager->UnregisterPlaceholderFrame((nsPlaceholderFrame*)childFrame);                // Destroy the out-of-flow frame only if aRemovedFrame is _not_        // one of its ancestor frames or if it is a popup frame.         // If aRemovedFrame is an ancestor of the out-of-flow frame, then         // the out-of-flow frame will be destroyed by aRemovedFrame.        const nsStyleDisplay* display = outOfFlowFrame->GetStyleDisplay();        if (display->mDisplay == NS_STYLE_DISPLAY_POPUP ||            !nsLayoutUtils::IsProperAncestorFrame(aRemovedFrame, outOfFlowFrame)) {          if (aDestroyQueue.IndexOf(outOfFlowFrame) < 0)            aDestroyQueue.AppendElement(outOfFlowFrame);        }        // We want to descend into the out-of-flow frame's subtree,        // not the placeholder frame's!        subtree = outOfFlowFrame;      }      // Recursively find and delete any of its out-of-flow frames,      // and remove the mapping from content objects to frames      DoDeletingFrameSubtree(aPresContext, aPresShell, aFrameManager, aDestroyQueue,                             aRemovedFrame, subtree);        // Get the next sibling child frame      childFrame = childFrame->GetNextSibling();    }    aFrame->GetAdditionalChildListName(childListIndex++, getter_AddRefs(childListName));  } while (childListName);  return NS_OK;}