nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(mDocument->GetScriptGlobalObject());
nsPIDOMWindow *domWindow = mDocument->GetWindow();
PresShell::DoCopy(){  if (!mDocument) return NS_ERROR_FAILURE;  nsCOMPtr<nsISelection> sel;  nsresult rv = GetSelectionForCopy(getter_AddRefs(sel));  if (NS_FAILED(rv))     return rv;  if (!sel)     return NS_ERROR_FAILURE;  // Now we have the selection.  Make sure it's nonzero:  PRBool isCollapsed;  sel->GetIsCollapsed(&isCollapsed);  if (isCollapsed)    return NS_OK;  // call the copy code  rv = nsCopySupport::HTMLCopy(sel, mDocument, nsIClipboard::kGlobalClipboard);  if (NS_FAILED(rv))    return rv;  // Now that we have copied, update the Paste menu item  nsCOMPtr<nsIDOMWindowInternal> domWindow =    do_QueryInterface(mDocument->GetScriptGlobalObject());  if (domWindow)  {    domWindow->UpdateCommands(NS_LITERAL_STRING("clipboard"));  }    return NS_OK;}