break; } case NS_FORM_INPUT_FILE: { nsAutoString val; GetValue(val); *_retval = !val.IsEmpty();
nsHTMLInputElement::IsSuccessful(nsIContent* aSubmitElement,                                 PRBool *_retval){  *_retval = PR_FALSE;  // if it's disabled, it won't submit  PRBool disabled;  nsresult rv = GetDisabled(&disabled);  if (disabled) {    return NS_OK;  }  PRInt32 type;  GetType(&type);    // if it dosn't have a name it we don't submit  if (type != NS_FORM_INPUT_IMAGE) {    nsAutoString val;    rv = GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, val);    if (rv == NS_CONTENT_ATTR_NOT_THERE) {      return NS_OK;    }  }  switch (type) {    case NS_FORM_INPUT_CHECKBOX:    case NS_FORM_INPUT_RADIO:    {      GetChecked(_retval);      break;    }    case NS_FORM_INPUT_HIDDEN:    case NS_FORM_INPUT_PASSWORD:    case NS_FORM_INPUT_TEXT:    {      *_retval = PR_TRUE;      break;    }    case NS_FORM_INPUT_FILE:    {      nsAutoString val;      GetValue(val);      *_retval = !val.IsEmpty();      break;    }    case NS_FORM_INPUT_RESET:    case NS_FORM_INPUT_BUTTON:    {      *_retval = PR_FALSE;      break;    }    case NS_FORM_INPUT_SUBMIT:    case NS_FORM_INPUT_IMAGE:    {      *_retval = (this == aSubmitElement);    }  }  return NS_OK;}