nsCOMPtr<nsIPresContext> presContext; mPresShell->GetPresContext(getter_AddRefs(presContext)); rootFrame->FirstChild(presContext, nsnull, &rootFrame);
rootFrame = rootFrame->GetFirstChild(nsnull);
nsPopupBoxObject::HidePopup(){  nsIFrame* ourFrame = GetFrame();  if (!ourFrame)    return NS_OK;    nsIFrame* rootFrame;  mPresShell->GetRootFrame(&rootFrame);  if (!rootFrame)    return NS_OK;  if (rootFrame) {    nsCOMPtr<nsIPresContext> presContext;    mPresShell->GetPresContext(getter_AddRefs(presContext));    rootFrame->FirstChild(presContext, nsnull, &rootFrame);     }  nsCOMPtr<nsIRootBox> rootBox(do_QueryInterface(rootFrame));  if (!rootBox)    return NS_OK;  nsIFrame* popupSetFrame;  rootBox->GetPopupSetFrame(&popupSetFrame);  if (!popupSetFrame)    return NS_OK;  nsCOMPtr<nsIPopupSetFrame> popupSet(do_QueryInterface(popupSetFrame));  if (!popupSet)    return NS_OK;  popupSet->HidePopup(ourFrame);  popupSet->DestroyPopup(ourFrame, PR_TRUE);  return NS_OK;}