NS_ENSURE_STATE(submissionElement);
if (!submissionElement || !nsXFormsUtils::IsXFormsElement(submissionElement, submission)) { return nsXFormsUtils::DispatchEvent(mElement, eEvent_BindingException); }
nsXFormsSubmitElement::HandleDefault(nsIDOMEvent *aEvent, PRBool *aHandled){  nsresult rv;    rv = nsXFormsControlStub::HandleDefault(aEvent, aHandled);  NS_ENSURE_SUCCESS(rv, rv);  if (*aHandled) {    return NS_OK;  }  nsAutoString type;  aEvent->GetType(type);  if (!(*aHandled = type.EqualsLiteral("DOMActivate")))    return NS_OK;  nsAutoString submissionID;  mElement->GetAttribute(NS_LITERAL_STRING("submission"), submissionID);  nsCOMPtr<nsIDOMDocument> ownerDoc;  mElement->GetOwnerDocument(getter_AddRefs(ownerDoc));  NS_ENSURE_STATE(ownerDoc);  nsCOMPtr<nsIDOMElement> submissionElement;  ownerDoc->GetElementById(submissionID, getter_AddRefs(submissionElement));  NS_ENSURE_STATE(submissionElement);  nsCOMPtr<nsIDOMEventTarget> targ = do_QueryInterface(submissionElement);  NS_ASSERTION(targ, "All elements should support nsIDOMEventTarget");  nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(ownerDoc);  NS_ASSERTION(targ, "All documents should support nsIDOMDocumentEvent");  nsCOMPtr<nsIDOMEvent> event;  docEvent->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));  NS_ENSURE_STATE(event);  rv = event->InitEvent(NS_LITERAL_STRING("xforms-submit"), PR_TRUE, PR_TRUE);  NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);  PRBool unused;  rv = targ->DispatchEvent(event, &unused);  NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);  *aHandled = PR_TRUE;  return NS_OK;}