nsCOMPtr<nsISupports> subShell; mPresShell->GetSubShellFor(mContent, getter_AddRefs(subShell)); if(!subShell)
nsCOMPtr<nsIDocument> doc, sub_doc; mPresShell->GetDocument(getter_AddRefs(doc));  doc->GetSubDocumentFor(mContent, getter_AddRefs(sub_doc));  if (!sub_doc) {
NS_IMETHODIMP nsIFrameBoxObject::GetDocShell(nsIDocShell** aResult){  *aResult = nsnull;  if (!mPresShell)    return NS_OK;  nsCOMPtr<nsISupports> subShell;  mPresShell->GetSubShellFor(mContent, getter_AddRefs(subShell));  if(!subShell)    return NS_OK;  return CallQueryInterface(subShell, aResult); //Addref happens here.}