nsIFrame*&       aNewFrame)
nsIFrame*&       aNewFrame, nsAbsoluteItems& aFixedItems)
HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext*  aPresContext,                                             nsIContent*      aDocElement,                                             nsIFrame*        aParentFrame,                                             nsIStyleContext* aParentStyleContext,                                             nsIFrame*&       aNewFrame){  // Resolve the style context for the document element  nsIStyleContext*  styleContext;  styleContext = aPresContext->ResolveStyleContextFor(aDocElement, aParentStyleContext);    // See if we're paginated  if (aPresContext->IsPaginated()) {    // Create an area frame for the document element    nsIFrame* areaFrame;    NS_NewAreaFrame(areaFrame, 0);    areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext);    // The area frame is the "initial containing block"    mInitialContainingBlock = areaFrame;    // Process the child content    nsAbsoluteItems  absoluteItems(areaFrame);    nsFrameItems     childItems;    ProcessChildren(aPresContext, aDocElement, areaFrame, absoluteItems, childItems);        // Set the initial child lists    areaFrame->SetInitialChildList(*aPresContext, nsnull, childItems.childList);    if (nsnull != absoluteItems.childList) {      areaFrame->SetInitialChildList(*aPresContext, nsLayoutAtoms::absoluteList,                                     absoluteItems.childList);    }    // Return the area frame    aNewFrame = areaFrame;    } else {    // Unless the 'overflow' policy forbids scrolling, wrap the frame in a    // scroll frame.    nsIFrame* scrollFrame = nsnull;    const nsStyleDisplay* display = (const nsStyleDisplay*)      styleContext->GetStyleData(eStyleStruct_Display);    if (IsScrollable(aPresContext, display)) {      NS_NewScrollFrame(scrollFrame);      scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext);          // The scrolled frame gets a pseudo element style context      nsIStyleContext*  scrolledPseudoStyle =        aPresContext->ResolvePseudoStyleContextFor(nsnull,                                                   nsHTMLAtoms::scrolledContentPseudo,                                                   styleContext);      NS_RELEASE(styleContext);      styleContext = scrolledPseudoStyle;    }    // Create an area frame for the document element. This serves as the    // "initial containing block"    nsIFrame* areaFrame;    // XXX Until we clean up how painting damage is handled, we need to use the    // flag that says that this is the body...    NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT);    areaFrame->Init(*aPresContext, aDocElement, scrollFrame ? scrollFrame :                    aParentFrame, styleContext);    nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, areaFrame,                                             styleContext, PR_FALSE);    // The area frame is the "initial containing block"    mInitialContainingBlock = areaFrame;        // Process the child content    nsAbsoluteItems  absoluteItems(areaFrame);    nsFrameItems     childItems;    ProcessChildren(aPresContext, aDocElement, areaFrame, absoluteItems, childItems);        // Set the initial child lists    areaFrame->SetInitialChildList(*aPresContext, nsnull, childItems.childList);    if (nsnull != absoluteItems.childList) {      areaFrame->SetInitialChildList(*aPresContext, nsLayoutAtoms::absoluteList,                                     absoluteItems.childList);    }    if (nsnull != scrollFrame) {      scrollFrame->SetInitialChildList(*aPresContext, nsnull, areaFrame);    }    aNewFrame = scrollFrame ? scrollFrame : areaFrame;  }  NS_RELEASE(styleContext);  return NS_OK;}