| 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 cb250901cebf9981ecdf844b0dbaade93acb50b4..a6816eae575a7fc794ed6c87d06cd422905eac49 100644
|
| --- a/components/autofill/content/renderer/form_autofill_util.cc
|
| +++ b/components/autofill/content/renderer/form_autofill_util.cc
|
| @@ -878,9 +878,8 @@ void FillFormField(const FormFieldData& data,
|
| } 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.
|
| - TruncateString(&value, input_element->maxLength());
|
| + if (input_element->maxLength() >= 0)
|
| + TruncateString(&value, input_element->maxLength());
|
| }
|
| field->setValue(value, true);
|
| }
|
|
|