scrollX = NS_STYLE_OVERFLOW_HIDDEN; scrollY = NS_STYLE_OVERFLOW_SCROLL; break; case NS_STYLE_OVERFLOW_VISIBLE: scrollX = scrollY = NS_STYLE_OVERFLOW_AUTO; break; default: scrollX = scrollY = scrolling;
scrollX = nsIScrollable::Scrollbar_Never; scrollY = nsIScrollable::Scrollbar_Always;
nsSubDocumentFrame::ShowDocShell(){  nsCOMPtr<nsIDocShell> docShell;  nsresult rv = GetDocShell(getter_AddRefs(docShell));  NS_ENSURE_SUCCESS(rv, rv);  nsCOMPtr<nsIPresShell> presShell;  docShell->GetPresShell(getter_AddRefs(presShell));  if (presShell) {    // The docshell is already showing, nothing left to do...    return NS_OK;  }  // pass along marginwidth, marginheight, scrolling so sub document  // can use it  nsSize margin = GetMargin();  docShell->SetMarginWidth(margin.width);  docShell->SetMarginHeight(margin.height);  // 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> sc(do_QueryInterface(docShell));  if (sc) {    PRInt32 scrolling = GetStyleDisplay()->mOverflow;    PRInt32 scrollX, scrollY;    switch (scrolling) {      case NS_STYLE_OVERFLOW_CLIP:        scrollX = NS_STYLE_OVERFLOW_HIDDEN;        scrollY = NS_STYLE_OVERFLOW_HIDDEN;        break;      case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL:        scrollX = NS_STYLE_OVERFLOW_SCROLL;        scrollY = NS_STYLE_OVERFLOW_HIDDEN;        break;      case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL:        scrollX = NS_STYLE_OVERFLOW_HIDDEN;        scrollY = NS_STYLE_OVERFLOW_SCROLL;        break;      case NS_STYLE_OVERFLOW_VISIBLE:        scrollX = scrollY = NS_STYLE_OVERFLOW_AUTO;        break;      default:        scrollX = scrollY = scrolling;        break;    }    sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,                                       scrollX);    sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_X,                                       scrollY);  }  PRInt32 itemType = nsIDocShellTreeItem::typeContent;  nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(docShell));  if (treeItem) {    treeItem->GetItemType(&itemType);  }  rv = CreateViewAndWidget(itemType == nsIDocShellTreeItem::typeChrome ?                                       eContentTypeUI : eContentTypeContent);  if (NS_FAILED(rv)) {    return rv;  }  nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(docShell));  if (baseWindow) {    baseWindow->InitWindow(nsnull, mInnerView->GetWidget(), 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();    baseWindow->SetVisibility(PR_TRUE);  }  return NS_OK;}