nsGUIEvent event(NS_FORM_SELECTED); rv = HandleDOMEvent(presContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
nsGUIEvent event(PR_TRUE, NS_FORM_SELECTED, nsnull); rv = HandleDOMEvent(presContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
nsHTMLTextAreaElement::Select(){  nsresult rv = NS_OK;  // first see if we are disabled or not. If disabled then do nothing.  nsAutoString disabled;  if (NS_CONTENT_ATTR_HAS_VALUE ==      nsGenericHTMLFormElement::GetAttr(kNameSpaceID_None,                                        nsHTMLAtoms::disabled, disabled)) {    return rv;  }  // XXX Bug?  We have to give the input focus before contents can be  // selected  // Just like SetFocus() but without the ScrollIntoView()!  nsCOMPtr<nsPresContext> presContext = GetPresContext();  nsEventStatus status = nsEventStatus_eIgnore;  nsGUIEvent event(NS_FORM_SELECTED);  rv = HandleDOMEvent(presContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);  // If the DOM event was not canceled (e.g. by a JS event handler  // returning false)  if (status == nsEventStatus_eIgnore) {    PRBool shouldFocus = ShouldFocus(this);    if (shouldFocus) {      presContext->EventStateManager()->SetContentState(this,                                                        NS_EVENT_STATE_FOCUS);    }    nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);    if (formControlFrame) {      if (shouldFocus) {        formControlFrame->SetFocus(PR_TRUE, PR_TRUE);      }      // Now Select all the text!      SelectAll(presContext);    }  }  return rv;}