GetScrolling(content));
scrolling);
nsHTMLFrameInnerFrame::ShowDocShell(nsIPresContext* aPresContext){  nsCOMPtr<nsIDocShell> docShell;  nsresult rv = GetDocShell(getter_AddRefs(docShell));  NS_ENSURE_SUCCESS(rv, rv);  PRBool is_document_synthetic = PR_FALSE;  if (mContent->IsContentOfType(nsIContent::eXUL)) {    // We're a XUL iframe/browser tag, for the XUL box object to    // docshell mapping to work we must force a document to be created    // at this point, if we don't, mozilla won't even start since it    // can't reach the docshell from the iframe/browser tags. That    // mapping is based on the subdocument map in the document, which    // obviously won't be setup until the subdocument is created.    // Make sure there's a document in the docshell.    nsCOMPtr<nsIDOMWindow> win(do_GetInterface(docShell));    NS_ENSURE_TRUE(win, NS_ERROR_UNEXPECTED);    nsCOMPtr<nsPIDOMWindow> pwin(do_QueryInterface(win));    nsCOMPtr<nsIDOMDocument> extant_dom_doc;    pwin->GetExtantDocument(getter_AddRefs(extant_dom_doc));    // This will synchronously create a document if there is no    // document in the window yet.    nsCOMPtr<nsIDOMDocument> dom_doc;    win->GetDocument(getter_AddRefs(dom_doc));    if (dom_doc != extant_dom_doc) {      is_document_synthetic = PR_TRUE;    }  }  nsCOMPtr<nsIPresShell> presShell;  docShell->GetPresShell(getter_AddRefs(presShell));  if (presShell) {    // The docshell is already showing, nothing left to do...    return NS_OK;  }  nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(docShell));  nsCOMPtr<nsIDocShellTreeItem> parentDocShellTreeItem;  docShellTreeItem->GetParent(getter_AddRefs(parentDocShellTreeItem));  nsCOMPtr<nsIDocShell> parentDocShell =    do_QueryInterface(parentDocShellTreeItem);  nsCOMPtr<nsIPresShell> parentPresShell;  parentDocShell->GetPresShell(getter_AddRefs(parentPresShell));  nsCOMPtr<nsIContent> content;  GetParentContent(getter_AddRefs(content));  // pass along marginwidth, marginheight, scrolling so sub document  // can use it  docShell->SetMarginWidth(GetMarginWidth(aPresContext, content));  docShell->SetMarginHeight(GetMarginHeight(aPresContext, content));  // Current and initial scrolling is set so that all succeeding docs  // will use the scrolling value set here, regardless if scrolling is  // set by viewing a particular document (e.g. XUL turns off scrolling)  nsCOMPtr<nsIScrollable> scrollableContainer(do_QueryInterface(docShell));  if (scrollableContainer) {    scrollableContainer->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,                                                        GetScrolling(content));    scrollableContainer->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_X,                                                        GetScrolling(content));  }  nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(docShell));  NS_ENSURE_TRUE(docShellAsItem, NS_ERROR_FAILURE);  nsCOMPtr<nsIWidget> widget;  rv = CreateViewAndWidget(aPresContext, getter_AddRefs(widget));  if (NS_FAILED(rv)) {    return rv;  }  nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(docShell));  if (baseWindow) {    baseWindow->InitWindow(nsnull, widget, 0, 0, 10, 10);    // This is kinda whacky, this "Create()" call doesn't really    // create anything, one starts to wonder why this was named    // "Create"...    baseWindow->Create();    PRBool is_document_loading = PR_TRUE;    mFrameLoader->GetIsDocumentLoading(&is_document_loading);    if (!is_document_synthetic || !is_document_loading) {      // We're about to either show a "real" document (i.e. not a      // synthetic about:blank document) or we're showing an iframe      // that we didn't load anything into yet (i.e. there was no      // src="..."  attribute on the iframe element. Make sure we show      // the window.      baseWindow->SetVisibility(PR_TRUE);    }  }  return NS_OK;}