Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4785)

Unified Diff: components/autofill/content/renderer/form_autofill_util.cc

Issue 1615003002: Fix behavior of HTMLInputElement.maxLength/minLength getter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try to fix interactive tests Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698