| Index: components/autofill/content/renderer/form_autofill_util.cc
|
| diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
|
| index 995bb06baf509bb79ca337cdb37d5a57230fc5e5..dad2979db1a3e7a88fe12465c0bcb7c9ece0cf48 100644
|
| --- a/components/autofill/content/renderer/form_autofill_util.cc
|
| +++ b/components/autofill/content/renderer/form_autofill_util.cc
|
| @@ -533,19 +533,16 @@ void FillFormField(const FormFieldData& data,
|
| field->setAutofilled(true);
|
|
|
| WebInputElement* input_element = toWebInputElement(field);
|
| - if (IsTextInput(input_element) || IsMonthInput(input_element)) {
|
| - // If the maxlength attribute contains a negative value, maxLength()
|
| - // returns the default maxlength value.
|
| - input_element->setValue(
|
| - data.value.substr(0, input_element->maxLength()), true);
|
| - } else if (IsTextAreaElement(*field) || IsSelectElement(*field)) {
|
| - if (field->value() != data.value) {
|
| - field->setValue(data.value);
|
| - field->dispatchFormControlChangeEvent();
|
| - }
|
| - } else {
|
| - DCHECK(IsCheckableElement(input_element));
|
| + if (IsCheckableElement(input_element)) {
|
| input_element->setChecked(data.is_checked, true);
|
| + } else {
|
| + base::string16 value = data.value;
|
| + if (IsTextInput(input_element) || IsMonthInput(input_element)) {
|
| + // If the maxlength attribute contains a negative value, maxLength()
|
| + // returns the default maxlength value.
|
| + value = value.substr(0, input_element->maxLength());
|
| + }
|
| + field->setValue(value, true);
|
| }
|
|
|
| if (is_initiating_node &&
|
|
|