nsCOMPtr<nsIPresShell> presShell; presContext->GetShell(getter_AddRefs(presShell)); if (presShell) { nsFormEvent event; event.eventStructType = NS_FORM_EVENT; event.message         = NS_FORM_SUBMIT; event.originator      = nsnull; nsEventStatus status  = nsEventStatus_eIgnore; presShell->HandleEventWithTarget(&event, nsnull, this, NS_EVENT_FLAG_INIT, &status); }
nsFormEvent event; event.eventStructType = NS_FORM_EVENT; event.message         = NS_FORM_SUBMIT; event.originator      = nsnull; nsEventStatus status  = nsEventStatus_eIgnore; HandleDOMEvent(presContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
nsHTMLFormElement::Submit(){  // Send the submit event  nsresult rv = NS_OK;  nsCOMPtr<nsIPresContext> presContext;  GetPresContext(this, getter_AddRefs(presContext));  if (presContext) {    if (InNavQuirksMode(mDocument)) {      // QUIRKS MODE: submit without calling event handlers. (bug 144534,      // original code added in bug 76694)      rv = DoSubmitOrReset(presContext, nsnull, NS_FORM_SUBMIT);    } else {      nsCOMPtr<nsIPresShell> presShell;      presContext->GetShell(getter_AddRefs(presShell));      if (presShell) {        nsFormEvent event;        event.eventStructType = NS_FORM_EVENT;        event.message         = NS_FORM_SUBMIT;        event.originator      = nsnull;        nsEventStatus status  = nsEventStatus_eIgnore;        presShell->HandleEventWithTarget(&event, nsnull, this,                                         NS_EVENT_FLAG_INIT, &status);      }    }  }  return rv;}