scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame);
HTMLStyleSheetImpl::ConstructRootFrame(nsIPresContext*  aPresContext,                                       nsIContent*      aContent,                                       nsIStyleContext* aStyleContext,                                       nsIFrame*&       aNewFrame){#ifdef NS_DEBUG    nsIDocument*  doc;    nsIContent*   rootContent;    // Verify it's the root content object    aContent->GetDocument(doc);    rootContent = doc->GetRootContent();    NS_RELEASE(doc);    NS_ASSERTION(rootContent == aContent, "unexpected content");    NS_RELEASE(rootContent);#endif  // Create the root frame  nsresult  rv = NS_NewHTMLFrame(aNewFrame);  if (NS_SUCCEEDED(rv)) {    // Bind root frame to root view (and root window)    nsIPresShell*   presShell = aPresContext->GetShell();    nsIViewManager* viewManager = presShell->GetViewManager();    nsIView*        rootView;      NS_RELEASE(presShell);    viewManager->GetRootView(rootView);    aNewFrame->SetView(rootView);    NS_RELEASE(viewManager);      // Initialize the frame    aNewFrame->Init(*aPresContext, aContent, nsnull, aStyleContext);      // See if we're paginated    if (aPresContext->IsPaginated()) {      nsIFrame*  scrollFrame;      nsIFrame*  pageSequenceFrame;      // XXX This isn't the correct pseudo element style context to use...      nsIStyleContext*  pseudoStyle;      pseudoStyle = aPresContext->ResolvePseudoStyleContextFor(aContent,                      nsHTMLAtoms::columnPseudo, aStyleContext);      // Wrap the simple page sequence frame in a scroll frame      // XXX Only do this if it's print preview      if NS_SUCCEEDED(NS_NewScrollFrame(scrollFrame)) {        // Initialize the frame        scrollFrame->Init(*aPresContext, aContent, aNewFrame, pseudoStyle);        // Create a simple page sequence frame        rv = NS_NewSimplePageSequenceFrame(pageSequenceFrame);        if (NS_SUCCEEDED(rv)) {          nsIFrame* pageFrame;          nsIFrame* childList;            // Initialize the frame and force it to have a view          pageSequenceFrame->Init(*aPresContext, aContent, scrollFrame, pseudoStyle);          nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame,                                                   pseudoStyle, PR_TRUE);          // Create the first page          NS_NewPageFrame(pageFrame);          // Initialize it and force it to have a view          // XXX Use a PAGE style context...          pageFrame->Init(*aPresContext, aContent, pageSequenceFrame, pseudoStyle);          nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame,                                                   pseudoStyle, PR_TRUE);          NS_RELEASE(pseudoStyle);            // Process the child content, and set the page and page sequence frame's          // initial child lists          rv = ProcessChildren(aPresContext, pageFrame, aContent, childList);          if (NS_SUCCEEDED(rv)) {            pageFrame->SetInitialChildList(*aPresContext, nsnull, childList);            pageSequenceFrame->SetInitialChildList(*aPresContext, nsnull, pageFrame);                // Set the scroll frame's initial child list            scrollFrame->SetInitialChildList(*aPresContext, nsnull, pageSequenceFrame);          }          // Set the root frame's initial child list          aNewFrame->SetInitialChildList(*aPresContext, nsnull, scrollFrame);        }      }    } else {      nsIFrame* childList;      // Process the child content, and set the frame's initial child list      rv = ProcessChildren(aPresContext, aNewFrame, aContent, childList);      if (NS_SUCCEEDED(rv)) {        aNewFrame->SetInitialChildList(*aPresContext, nsnull, childList);      }    }  }  return rv;  }