doc->GetRootContent(getter_AddRefs(rootContent));
rootContent = doc->GetRootContent();
NS_IMETHODIMP nsSelection::SelectAll(){  nsCOMPtr<nsIContent> rootContent;  if (mLimiter)  {    rootContent = mLimiter;//addrefit  }  else  {    nsresult rv;    nsCOMPtr<nsIPresShell> shell(do_QueryInterface(mTracker,&rv));    if (NS_FAILED(rv) || !shell) {      return NS_ERROR_FAILURE;    }    nsCOMPtr<nsIDocument> doc;    rv = shell->GetDocument(getter_AddRefs(doc));    if (NS_FAILED(rv))      return rv;    if (!doc)      return NS_ERROR_FAILURE;    doc->GetRootContent(getter_AddRefs(rootContent));    if (!rootContent)      return NS_ERROR_FAILURE;  }  PRInt32 numChildren = rootContent->GetChildCount();  PostReason(nsISelectionListener::NO_REASON);  return TakeFocus(mLimiter, 0, numChildren, PR_FALSE, PR_FALSE);}