if (InNavQuirksMode(mDocument)) {
if (InNavQuirksMode(mDocument) || mGeneratingSubmit) {
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 {      // Calling HandleDOMEvent() directly so that submit() will work even if      // the frame does not exist.  This does not have an effect right now, but      // If PresShell::HandleEventWithTarget() ever starts to work for elements      // without frames, that should be called instead.      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);    }  }  return rv;}