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

Unified Diff: components/autofill/core/browser/autofill_field.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/core/browser/autofill_field.cc
diff --git a/components/autofill/core/browser/autofill_field.cc b/components/autofill/core/browser/autofill_field.cc
index 754ec0175be74bfcf416f6c51d84048fdc0f2eaf..c9c5720cdaa457e35010d50626b4c3fa35a17583 100644
--- a/components/autofill/core/browser/autofill_field.cc
+++ b/components/autofill/core/browser/autofill_field.cc
@@ -596,7 +596,7 @@ base::string16 AutofillField::GetPhoneNumberValue(
// provide a valid number for the field. For example, the number 15142365264
// with a field with a max length of 10 would return 5142365264, thus removing
// the country code and remaining valid.
- if (number.length() > field_data.max_length) {
+ if (static_cast<int>(number.length()) > field_data.max_length && field_data.max_length > -1) {
return number.substr(number.length() - field_data.max_length,
field_data.max_length);
}

Powered by Google App Engine
This is Rietveld 408576698