nsCOMPtr<nsIContent> root; doc->GetRootContent(getter_AddRefs(root));
nsIContent *root = doc->GetRootContent();
DumpContentRecur(nsIDocShell* aDocShell, FILE* out){#ifdef DEBUG    if (nsnull != aDocShell) {        fprintf(out, "docshell=%p \n", NS_STATIC_CAST(void*, aDocShell));        nsCOMPtr<nsIDocument> doc(document(aDocShell));        if (doc) {            nsCOMPtr<nsIContent> root;            doc->GetRootContent(getter_AddRefs(root));            if (root) {                root->List(out);            }        }        else {            fputs("no document\n", out);        }        // dump the frames of the sub documents        PRInt32 i, n;        nsCOMPtr<nsIDocShellTreeNode> docShellAsNode(do_QueryInterface(aDocShell));        docShellAsNode->GetChildCount(&n);        for (i = 0; i < n; ++i) {            nsCOMPtr<nsIDocShellTreeItem> child;            docShellAsNode->GetChildAt(i, getter_AddRefs(child));            nsCOMPtr<nsIDocShell> childAsShell(do_QueryInterface(child));            if (child) {                DumpContentRecur(childAsShell, out);            }        }    }#endif}