child->FirstChild(mPresContext, nsnull, &child);
child = child->GetFirstChild(nsnull);
PresShell::GetPageSequenceFrame(nsIPageSequenceFrame** aResult) const{  NS_PRECONDITION(nsnull != aResult, "null ptr");  if (nsnull == aResult) {    return NS_ERROR_NULL_POINTER;  }  nsIFrame*             rootFrame;  nsIFrame*             child;  nsIPageSequenceFrame* pageSequence = nsnull;  // The page sequence frame is the child of the rootFrame  mFrameManager->GetRootFrame(&rootFrame);  rootFrame->FirstChild(mPresContext, nsnull, &child);  if (nsnull != child) {      // but the child could be wrapped in a scrollframe so lets check      nsIScrollableFrame* scrollable = nsnull;      nsresult rv = child->QueryInterface(NS_GET_IID(nsIScrollableFrame),                                          (void **)&scrollable);      if (NS_SUCCEEDED(rv) && (nsnull != scrollable)) {          // if it is then get the scrolled frame          scrollable->GetScrolledFrame(nsnull, child);      } else {        nsCOMPtr<nsIPrintPreviewContext> ppContext = do_QueryInterface(mPresContext);        if (ppContext) {          child->FirstChild(mPresContext, nsnull, &child);        }      }      // make sure the child is a pageSequence      rv = child->QueryInterface(NS_GET_IID(nsIPageSequenceFrame),                                 (void**)&pageSequence);      NS_ASSERTION(NS_SUCCEEDED(rv),"Error: Could not find pageSequence!");      *aResult = pageSequence;      return NS_OK;  }  *aResult = nsnull;  return NS_ERROR_FAILURE;}