if (mType != NS_FORM_INPUT_IMAGE) {    CancelImageRequests(); }
nsHTMLInputElement::AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,                                 const nsAString* aValue,                                 PRBool aNotify){  if (aNameSpaceID != kNameSpaceID_None) {    return;  }  //  // When name or type changes, radio should be added to radio group.  // (type changes are handled in the form itself currently)  // If the parser is not done creating the radio, we also should not do it.  //  if ((aName == nsHTMLAtoms::name || (aName == nsHTMLAtoms::type && !mForm)) &&      mType == NS_FORM_INPUT_RADIO &&      (mForm || !(GET_BOOLBIT(mBitField, BF_PARSER_CREATING)))) {    AddedToRadioGroup();  }  //  // Some elements have to change their value when the value and checked  // attributes change (but they only do so when ValueChanged() and  // CheckedChanged() are false--i.e. the value has not been changed by the  // user or by JS)  //  // We only really need to call reset for the value so that the text control  // knows the new value.  No other reason.  //  if (aName == nsHTMLAtoms::value &&      !GET_BOOLBIT(mBitField, BF_VALUE_CHANGED) &&      (mType == NS_FORM_INPUT_TEXT ||       mType == NS_FORM_INPUT_PASSWORD ||       mType == NS_FORM_INPUT_FILE)) {    Reset();  }  //  // Checked must be set no matter what type of control it is, since  // GetChecked() must reflect the new value  //  if (aName == nsHTMLAtoms::checked &&      !GET_BOOLBIT(mBitField, BF_CHECKED_CHANGED)) {    // Delay setting checked if the parser is creating this element (wait until    // everything is set)    if (GET_BOOLBIT(mBitField, BF_PARSER_CREATING)) {      SET_BOOLBIT(mBitField, BF_SHOULD_INIT_CHECKED, PR_TRUE);    } else {      PRBool defaultChecked;      GetDefaultChecked(&defaultChecked);      DoSetChecked(defaultChecked);      SetCheckedChanged(PR_FALSE);    }  }  if (aName == nsHTMLAtoms::type) {    if (!aValue) {      // We're now a text input.  Note that we have to handle this manually,      // since removing an attribute (which is what happened, since aValue is      // null) doesn't call ParseAttribute.      mType = NS_FORM_INPUT_TEXT;    }        // If we are changing type from File/Text/Passwd to other input types    // we need save the mValue into value attribute    if (mValue &&        mType != NS_FORM_INPUT_TEXT &&        mType != NS_FORM_INPUT_PASSWORD &&        mType != NS_FORM_INPUT_FILE) {      SetAttr(kNameSpaceID_None, nsHTMLAtoms::value,              NS_ConvertUTF8toUCS2(mValue), PR_FALSE);      if (mValue) {        nsMemory::Free(mValue);        mValue = nsnull;      }    }    if (aNotify && mType == NS_FORM_INPUT_IMAGE && !mCurrentRequest) {      // We just got switched to be an image input; we should see      // whether we have an image to load;      nsAutoString src;      nsresult rv = GetAttr(kNameSpaceID_None, nsHTMLAtoms::src, src);      if (rv == NS_CONTENT_ATTR_HAS_VALUE) {        ImageURIChanged(src, PR_FALSE);      }    }  }}