domWindow->UpdateCommands(NS_ConvertASCIItoUCS2("clipboard"));
domWindow->UpdateCommands(NS_LITERAL_STRING("clipboard"));
PresShell::DoCopy(){  nsCOMPtr<nsIDocument> doc;  GetDocument(getter_AddRefs(doc));  if (!doc) return NS_ERROR_FAILURE;    nsresult rv;  nsCOMPtr<nsISelection> sel;  nsCOMPtr<nsIEventStateManager> manager;  nsCOMPtr<nsIContent> content;  rv = mPresContext->GetEventStateManager(getter_AddRefs(manager));  if (NS_FAILED(rv))     return rv;  if (!manager)     return NS_ERROR_FAILURE;  rv = manager->GetFocusedContent(getter_AddRefs(content));  if (NS_SUCCEEDED(rv) && content)  {    //check to see if we need to get selection from frame    //optimization that MAY need to be expanded as more things implement their own "selection"    nsCOMPtr<nsIDOMNSHTMLInputElement>    htmlInputElement(do_QueryInterface(content));    nsCOMPtr<nsIDOMNSHTMLTextAreaElement> htmlTextAreaElement(do_QueryInterface(content));    if (htmlInputElement || htmlTextAreaElement)    {      nsIFrame *htmlInputFrame;      rv = GetPrimaryFrameFor(content, &htmlInputFrame);      if (NS_FAILED(rv))         return rv;      if (!htmlInputFrame)         return NS_ERROR_FAILURE;      nsCOMPtr<nsISelectionController> selCon;      rv = htmlInputFrame->GetSelectionController(mPresContext,getter_AddRefs(selCon));      if (NS_FAILED(rv))         return rv;      if (!selCon)         return NS_ERROR_FAILURE;      rv = selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(sel));    }  }  if (!sel) //get selection from this PresShell    rv = GetSelection(nsISelectionController::SELECTION_NORMAL, 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, doc, nsIClipboard::kGlobalClipboard);  if (NS_FAILED(rv))    return rv;  // Now that we have copied, update the Paste menu item  nsCOMPtr<nsIScriptGlobalObject> globalObject;  doc->GetScriptGlobalObject(getter_AddRefs(globalObject));    nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(globalObject);  if (domWindow)  {    domWindow->UpdateCommands(NS_ConvertASCIItoUCS2("clipboard"));  }    return NS_OK;}