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

Unified Diff: components/autofill/core/browser/address_field.cc

Issue 676983004: Autofill: Fix recognition of Walmart ZIP code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: retry upload Created 6 years, 2 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
« no previous file with comments | « chrome/test/data/autofill/heuristics/output/20_checkout_m_walmart.com.out ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/address_field.cc
diff --git a/components/autofill/core/browser/address_field.cc b/components/autofill/core/browser/address_field.cc
index 2e272b9f93fa161df27e10ffc5dd294775112207..2ef170e2e91dd43a9f025408327d0658b1ab5c5d 100644
--- a/components/autofill/core/browser/address_field.cc
+++ b/components/autofill/core/browser/address_field.cc
@@ -196,13 +196,21 @@ bool AddressField::ParseZipCode(AutofillScanner* scanner) {
if (zip_)
return false;
- base::string16 pattern = UTF8ToUTF16(autofill::kZipCodeRe);
- if (!ParseField(scanner, pattern, &zip_))
+ // Some sites use type="tel" for zip fields (to get a numerical input).
+ // http://crbug.com/426958
Ilya Sherman 2014/10/24 20:28:13 Ouch.
Evan Stade 2014/10/24 20:32:16 It seems to be pretty prevalent on mobile sites. I
+ if (!ParseFieldSpecifics(scanner,
+ UTF8ToUTF16(autofill::kZipCodeRe),
+ MATCH_DEFAULT | MATCH_TELEPHONE,
+ &zip_)) {
return false;
+ }
// Look for a zip+4, whose field name will also often contain
// the substring "zip".
- ParseField(scanner, UTF8ToUTF16(autofill::kZip4Re), &zip4_);
+ ParseFieldSpecifics(scanner,
+ UTF8ToUTF16(autofill::kZip4Re),
+ MATCH_DEFAULT | MATCH_TELEPHONE,
+ &zip4_);
return true;
}
« no previous file with comments | « chrome/test/data/autofill/heuristics/output/20_checkout_m_walmart.com.out ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698