From 53f188c05bee5645368e7989c0b5a6af7cb0f9c8 Mon Sep 17 00:00:00 2001 From: brettw Date: Wed, 26 Nov 2014 13:59:17 -0800 Subject: Revert of Revert of Add address3 autofill heuristics. (patchset #1 id:1 of https://codereview.chromium.org/757333004/) Reason for revert: Unreverting this patch. Can not reproduce timeout locally, and the single bot that was having the timeout seems to be having related failures even with my patch reverted. Original issue's description: > Revert of Add address3 autofill heuristics. (patchset #6 id:100001 of https://codereview.chromium.org/741493003/) > > Reason for revert: > Causes AutofillOptionsWebUITest.testOpenAutofillOptions to hang. > > Original issue's description: > > Add address3 autofill heuristics. > > > > We already had "address line 3" typedefs and it's supported in requestAutocomplete, but this was hot hooked up to the heuristic code. > > > > Hooking this up messed up the urban outfitters detection because of the greedy nature (matches empty labels) of the address2 detection. Adding this to address3 triggered a bad case due to bad luck (rather than design, this would also happen in the old code if there was no address3, because the unclassified address3 served to separate the address and unlabeled city). To address this problem, this patch checks for a city before matching lines with empty lines. I believe this should be a good general fix for similar patterns that we would have had with the existing "address line 2" support. > > > > Ignores duplicate form fields when one of them is hidden. Previously if there was a hidden form element and then a visible one of the same autodetected type, it would split the form (however, the reverse didn't split). It's common to have hidden sections with duplicate types in them for different locales. This unsplits llbean and continental. > > > > R=estade@chromium.org, isherman@chromium.org > > > > Committed: https://chromium.googlesource.com/chromium/src/+/c7d64a4aed4c23e9a0a6d8e85a30046fa4bf77e1 > > TBR=isherman@chromium.org,estade@chromium.org > NOTREECHECKS=true > NOTRY=true > > Committed: https://crrev.com/af82794391afb28318736af4bae6b3600d310484 > Cr-Commit-Position: refs/heads/master@{#305853} TBR=isherman@chromium.org,estade@chromium.org NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/757223005 Cr-Commit-Position: refs/heads/master@{#305887} --- .../browser/autofill/form_structure_browsertest.cc | 2 + .../data/autofill/heuristics/input/20_llbean.html | 295 +++++++++++++++++++++ .../output/08_register_continental.com.out | 52 ++-- .../heuristics/output/10_register_gymboree.com.out | 2 +- .../autofill/heuristics/output/17_crbug_224601.out | 2 +- .../data/autofill/heuristics/output/20_llbean.out | 38 +++ 6 files changed, 363 insertions(+), 28 deletions(-) create mode 100644 chrome/test/data/autofill/heuristics/input/20_llbean.html create mode 100644 chrome/test/data/autofill/heuristics/output/20_llbean.out (limited to 'chrome') diff --git a/chrome/browser/autofill/form_structure_browsertest.cc b/chrome/browser/autofill/form_structure_browsertest.cc index 958dea5..df8a9c3 100644 --- a/chrome/browser/autofill/form_structure_browsertest.cc +++ b/chrome/browser/autofill/form_structure_browsertest.cc @@ -26,6 +26,8 @@ const base::FilePath::CharType kTestName[] = FILE_PATH_LITERAL("heuristics"); // Convert the |html| snippet to a data URI. GURL HTMLToDataURI(const std::string& html) { + // GURL requires data URLs to be UTF-8 and will fail below if it's not. + CHECK(base::IsStringUTF8(html)) << "Input file is not UTF-8."; return GURL(std::string("data:text/html;charset=utf-8,") + html); } diff --git a/chrome/test/data/autofill/heuristics/input/20_llbean.html b/chrome/test/data/autofill/heuristics/input/20_llbean.html new file mode 100644 index 0000000..bf7f4a0 --- /dev/null +++ b/chrome/test/data/autofill/heuristics/input/20_llbean.html @@ -0,0 +1,295 @@ + + +
+ + +
+ + +
+
+ + +
+
+ + +
+
+ + + +
+
+ + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + +
+
+
+ +
+ +
+
+
+ + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+ +
+ +
+
+

Enter Zip for City and State

+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ + +
+ + +
+
+
+ + + +
+
+
+ +
+
+ +
+ + +
+
+
+ +
+
+ +
+
+ + +
+ diff --git a/chrome/test/data/autofill/heuristics/output/08_register_continental.com.out b/chrome/test/data/autofill/heuristics/output/08_register_continental.com.out index 6ad5edc..c3fc1ff 100644 --- a/chrome/test/data/autofill/heuristics/output/08_register_continental.com.out +++ b/chrome/test/data/autofill/heuristics/output/08_register_continental.com.out @@ -15,30 +15,30 @@ UNKNOWN_TYPE | ctl00$ContentInfo$AddressType$AddressType | Address Type: | rdoAd UNKNOWN_TYPE | ctl00$ContentInfo$AddressType$AddressType | Home Business/Other | rdoAddTypeBusiness | ctl00$CustomerHeader$ddlCountries_1-default ADDRESS_HOME_LINE1 | ctl00$ContentInfo$Address$address1$txtAddress1 | Street Address: | | ctl00$CustomerHeader$ddlCountries_1-default ADDRESS_HOME_LINE2 | ctl00$ContentInfo$Address$address2$txtAddress2 | Street Address: | | ctl00$CustomerHeader$ddlCountries_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$Address$address3$txtAddress2 | Street Address: | | ctl00$CustomerHeader$ddlCountries_1-default +ADDRESS_HOME_LINE3 | ctl00$ContentInfo$Address$address3$txtAddress2 | Street Address: | | ctl00$CustomerHeader$ddlCountries_1-default ADDRESS_HOME_CITY | ctl00$ContentInfo$Address$city$txtCity | City/Town/Department: | | ctl00$CustomerHeader$ddlCountries_1-default -ADDRESS_HOME_STATE | ctl00$ContentInfo$Address$state$txtState | State/Province/Region/County: | | ctl00$ContentInfo$Address$state$txtState_1-default -ADDRESS_HOME_ZIP | ctl00$ContentInfo$Address$zip$txtZip | ZIP/Postal Code: | | ctl00$ContentInfo$Address$state$txtState_1-default -ADDRESS_HOME_COUNTRY | ctl00$ContentInfo$Address$country$cboCountry | Country: | US | ctl00$ContentInfo$Address$state$txtState_1-default -PHONE_HOME_WHOLE_NUMBER | ctl00$ContentInfo$HomePhone$txtNumber$txtPhone | Home PhoneNumber: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$HomePhone$txtExt$txtPhoneExt | Ext./PIN (optional): | | ctl00$ContentInfo$Address$state$txtState_1-default -ADDRESS_HOME_COUNTRY | ctl00$ContentInfo$HomePhone$cboCountry$cboCountry | Country: | US | ctl00$ContentInfo$Address$state$txtState_1-default -PHONE_HOME_WHOLE_NUMBER | ctl00$ContentInfo$BusinessPhone$txtNumber$txtPhone | Business/Other PhoneNumber: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$BusinessPhone$txtExt$txtPhoneExt | Ext./PIN (optional): | | ctl00$ContentInfo$Address$state$txtState_1-default -ADDRESS_HOME_COUNTRY | ctl00$ContentInfo$BusinessPhone$cboCountry$cboCountry | Country: | US | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$HomeAirport$txtAirport | Home Airport (optional): | | ctl00$ContentInfo$Address$state$txtState_1-default -EMAIL_ADDRESS | ctl00$ContentInfo$Email$txtEmail | E-mail Address: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$chkSubOpStatement | | on | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$chkSubopnewsoffers | | on | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$chkSubcocomspecials | | on | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$chkSubtripnotes | | on | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$NewPin$txtNewPin$txtNewPin | New PIN: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$NewPin$txtConfPin$txtConfPin | Re-type New PIN: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$UsernamePassword$username$txtUsername | Username: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$UsernamePassword$password$txtPassword | Password: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$UsernamePassword$passwordRetype$txtPassword | Re-type Password: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$PINPasswordReminder$PINReminder1$txtPINReminder | PIN Reminder: (cannot include any numbers) | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$SecurityQuestionAnswer$Question$txtSecurity | Security Question: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$SecurityQuestionAnswer$Answer$txtSecurity | Answer: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$SecurityQuestionAnswer$AnswerReType$txtSecurity | Re-type Answer: | | ctl00$ContentInfo$Address$state$txtState_1-default -UNKNOWN_TYPE | ctl00$ContentInfo$txtAgreement | Username and Password (optional)You have the option to create your own easy to remember username or password to sign in to continental.com. The username can be used in place of your OnePass account number and a password can be used in place of your PIN. PIN/Password ReminderIf you forget your PIN or password, we will provide this reminder to access your account.PIN Reminder: (cannot include any numbers)Security Question | Agreement Between User And Continental AirlinesThis Web site is offered to the user conditioned on acceptance by the user ("User") without modification of the terms, conditions, and notices contained herein. By accessing and using this Web site, the User is deemed to have agreed to all such terms, conditions, and notices (the "Agreement").OnePass Terms and ConditionsContinental Airlines and all OnePass partners reserve the right to change any aspect of the OnePass program at any time within 30 days notice to active members. This right includes, but is not limited to, changes in partner affiliation, rules for earning mileage credit and mileage redemption levels. However, rules for use of travel rewards, cities served, flight schedules, limited seating or space availability, restricted travel dates and specific features of promotional offers are subject to change with or without notice at the discretion of Continental Airlines or the OnePass partner. Continental Airlines is not responsible for unilateral action | ctl00$ContentInfo$Address$state$txtState_1-default +ADDRESS_HOME_STATE | ctl00$ContentInfo$Address$state$txtState | State/Province/Region/County: | | ctl00$CustomerHeader$ddlCountries_1-default +ADDRESS_HOME_ZIP | ctl00$ContentInfo$Address$zip$txtZip | ZIP/Postal Code: | | ctl00$CustomerHeader$ddlCountries_1-default +ADDRESS_HOME_COUNTRY | ctl00$ContentInfo$Address$country$cboCountry | Country: | US | ctl00$CustomerHeader$ddlCountries_1-default +PHONE_HOME_WHOLE_NUMBER | ctl00$ContentInfo$HomePhone$txtNumber$txtPhone | Home PhoneNumber: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$HomePhone$txtExt$txtPhoneExt | Ext./PIN (optional): | | ctl00$CustomerHeader$ddlCountries_1-default +ADDRESS_HOME_COUNTRY | ctl00$ContentInfo$HomePhone$cboCountry$cboCountry | Country: | US | ctl00$CustomerHeader$ddlCountries_1-default +PHONE_HOME_WHOLE_NUMBER | ctl00$ContentInfo$BusinessPhone$txtNumber$txtPhone | Business/Other PhoneNumber: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$BusinessPhone$txtExt$txtPhoneExt | Ext./PIN (optional): | | ctl00$CustomerHeader$ddlCountries_1-default +ADDRESS_HOME_COUNTRY | ctl00$ContentInfo$BusinessPhone$cboCountry$cboCountry | Country: | US | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$HomeAirport$txtAirport | Home Airport (optional): | | ctl00$CustomerHeader$ddlCountries_1-default +EMAIL_ADDRESS | ctl00$ContentInfo$Email$txtEmail | E-mail Address: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$chkSubOpStatement | | on | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$chkSubopnewsoffers | | on | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$chkSubcocomspecials | | on | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$chkSubtripnotes | | on | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$NewPin$txtNewPin$txtNewPin | New PIN: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$NewPin$txtConfPin$txtConfPin | Re-type New PIN: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$UsernamePassword$username$txtUsername | Username: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$UsernamePassword$password$txtPassword | Password: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$UsernamePassword$passwordRetype$txtPassword | Re-type Password: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$PINPasswordReminder$PINReminder1$txtPINReminder | PIN Reminder: (cannot include any numbers) | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$SecurityQuestionAnswer$Question$txtSecurity | Security Question: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$SecurityQuestionAnswer$Answer$txtSecurity | Answer: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$SecurityQuestionAnswer$AnswerReType$txtSecurity | Re-type Answer: | | ctl00$CustomerHeader$ddlCountries_1-default +UNKNOWN_TYPE | ctl00$ContentInfo$txtAgreement | Username and Password (optional)You have the option to create your own easy to remember username or password to sign in to continental.com. The username can be used in place of your OnePass account number and a password can be used in place of your PIN. PIN/Password ReminderIf you forget your PIN or password, we will provide this reminder to access your account.PIN Reminder: (cannot include any numbers)Security Question | Agreement Between User And Continental AirlinesThis Web site is offered to the user conditioned on acceptance by the user ("User") without modification of the terms, conditions, and notices contained herein. By accessing and using this Web site, the User is deemed to have agreed to all such terms, conditions, and notices (the "Agreement").OnePass Terms and ConditionsContinental Airlines and all OnePass partners reserve the right to change any aspect of the OnePass program at any time within 30 days notice to active members. This right includes, but is not limited to, changes in partner affiliation, rules for earning mileage credit and mileage redemption levels. However, rules for use of travel rewards, cities served, flight schedules, limited seating or space availability, restricted travel dates and specific features of promotional offers are subject to change with or without notice at the discretion of Continental Airlines or the OnePass partner. Continental Airlines is not responsible for unilateral action | ctl00$CustomerHeader$ddlCountries_1-default diff --git a/chrome/test/data/autofill/heuristics/output/10_register_gymboree.com.out b/chrome/test/data/autofill/heuristics/output/10_register_gymboree.com.out index 5638f76..ddb0a01 100644 --- a/chrome/test/data/autofill/heuristics/output/10_register_gymboree.com.out +++ b/chrome/test/data/autofill/heuristics/output/10_register_gymboree.com.out @@ -4,7 +4,7 @@ NAME_FIRST | USER_ACCOUNT<>firstName | First Name* | | LOYALTY_ACCOUNT<>email_1 NAME_LAST | USER_ACCOUNT<>lastName | Last Name* | | LOYALTY_ACCOUNT<>email_1-default ADDRESS_HOME_LINE1 | LOYALTY_ADDRESS<>address1 | Address Line 1* | | LOYALTY_ACCOUNT<>email_1-default ADDRESS_HOME_LINE2 | LOYALTY_ADDRESS<>address2 | Address Line 2 | | LOYALTY_ACCOUNT<>email_1-default -UNKNOWN_TYPE | LOYALTY_ADDRESS<>address3 | Address Line 3 | | LOYALTY_ACCOUNT<>email_1-default +ADDRESS_HOME_LINE3 | LOYALTY_ADDRESS<>address3 | Address Line 3 | | LOYALTY_ACCOUNT<>email_1-default ADDRESS_HOME_CITY | LOYALTY_ADDRESS<>city | City* | | LOYALTY_ACCOUNT<>email_1-default ADDRESS_HOME_STATE | LOYALTY_ADDRESS<>state_cd | State/Province* | | LOYALTY_ACCOUNT<>email_1-default ADDRESS_HOME_ZIP | LOYALTY_ADDRESS<>postal | Zip/Postal Code*! | | LOYALTY_ACCOUNT<>email_1-default diff --git a/chrome/test/data/autofill/heuristics/output/17_crbug_224601.out b/chrome/test/data/autofill/heuristics/output/17_crbug_224601.out index 6feabf5..c71486e 100644 --- a/chrome/test/data/autofill/heuristics/output/17_crbug_224601.out +++ b/chrome/test/data/autofill/heuristics/output/17_crbug_224601.out @@ -42,7 +42,7 @@ PHONE_HOME_WHOLE_NUMBER | Register1$txtEveningPhone | Evening phone: | | txtSea PHONE_HOME_WHOLE_NUMBER | Register1$txtMobilePhone | Mobile phone: | | txtSearch_1-default ADDRESS_HOME_LINE1 | Register1$txtAddress1 | Address Line 1: * | | txtSearch_1-default ADDRESS_HOME_LINE2 | Register1$txtAddress2 | Address Line 2: * | | txtSearch_1-default -UNKNOWN_TYPE | Register1$txtAddress3 | Address Line 3: | | txtSearch_1-default +ADDRESS_HOME_LINE3 | Register1$txtAddress3 | Address Line 3: | | txtSearch_1-default UNKNOWN_TYPE | Register1$txtAddress4 | Address Line 4: | | txtSearch_1-default UNKNOWN_TYPE | Register1$txtAddress5 | Address Line 5: | | txtSearch_1-default ADDRESS_HOME_ZIP | Register1$txtPostCode | Post Code: * | | txtSearch_1-default diff --git a/chrome/test/data/autofill/heuristics/output/20_llbean.out b/chrome/test/data/autofill/heuristics/output/20_llbean.out new file mode 100644 index 0000000..d7c283a --- /dev/null +++ b/chrome/test/data/autofill/heuristics/output/20_llbean.out @@ -0,0 +1,38 @@ +UNKNOWN_TYPE | personTitle | Title (optional) | | personTitle_1-default +NAME_FIRST | firstName | First Name | | personTitle_1-default +NAME_MIDDLE | middleName | Middle Name(optional) | | personTitle_1-default +NAME_LAST | lastName | Last Name | | personTitle_1-default +UNKNOWN_TYPE | gender | Gender (optional) | M | personTitle_1-default +UNKNOWN_TYPE | gender | Gender (optional) | F | personTitle_1-default +ADDRESS_HOME_COUNTRY | country | Country | USA | personTitle_1-default +ADDRESS_HOME_ZIP | JPNPostal | Postal Code | | personTitle_1-default +UNKNOWN_TYPE | JPNPrefecture | Prefecture | | personTitle_1-default +ADDRESS_HOME_CITY | JPNCity | City | | personTitle_1-default +COMPANY_NAME | organizationName | Business, Attention, or In Care of Name (optional) | | personTitle_1-default +UNKNOWN_TYPE | orgNameInd | Business, Attention, or In Care of Name (optional) | BUS | personTitle_1-default +UNKNOWN_TYPE | orgNameInd | Business, Attention, or In Care of Name (optional) | C/O | personTitle_1-default +UNKNOWN_TYPE | orgNameInd | Business, Attention, or In Care of Name (optional) | ATTN | personTitle_1-default +ADDRESS_HOME_LINE1 | address1 | Address | | personTitle_1-default +ADDRESS_HOME_LINE2 | address2 | Address Line 2 (optional) | | personTitle_1-default +ADDRESS_HOME_LINE3 | address3 | Address Line 3 (optional) | | personTitle_1-default +ADDRESS_HOME_ZIP | zipCode | Zip Code | | personTitle_1-default +ADDRESS_HOME_CITY | city | City | | personTitle_1-default +ADDRESS_HOME_STATE | state | State | | personTitle_1-default +ADDRESS_HOME_ZIP | CAPostal | Postal Code | | personTitle_1-default +ADDRESS_HOME_CITY | CACity | City | | personTitle_1-default +ADDRESS_HOME_STATE | CAProvince | Province | | personTitle_1-default +ADDRESS_HOME_CITY | INTLCity | City | | personTitle_1-default +ADDRESS_HOME_STATE | INTLCounty | County | | personTitle_1-default +ADDRESS_HOME_ZIP | INTLPostal | Postal Code | | personTitle_1-default +PHONE_HOME_WHOLE_NUMBER | phone1 | Daytime Phone Number (optional) | | personTitle_1-default +PHONE_HOME_WHOLE_NUMBER | intlPhone1Prefix | International Country Code | | personTitle_1-default +PHONE_HOME_WHOLE_NUMBER | intlPhone1 | Daytime Phone Number | | personTitle_1-default +UNKNOWN_TYPE | phone1_Loc | International Country Code Daytime Phone Number | H | personTitle_1-default +UNKNOWN_TYPE | phone1_Loc | International Country Code Daytime Phone Number | B | personTitle_1-default +UNKNOWN_TYPE | phone1_Loc | International Country Code Daytime Phone Number | M | personTitle_1-default +UNKNOWN_TYPE | ckoutShippingCheck | Daytime Phone Number (optional) International Country Code Daytime Phone Number | ckoutShippingCheck | personTitle_1-default +UNKNOWN_TYPE | shipModeId | Shipping | 10 | personTitle_1-default +UNKNOWN_TYPE | shipModeId | Shipping | 11 | personTitle_1-default +UNKNOWN_TYPE | shipLiability | Shipping | on | personTitle_1-default +UNKNOWN_TYPE | shipAddGiftMsg | Shipping | addGiftMsg | personTitle_1-default +UNKNOWN_TYPE | giftMsg | Message | | personTitle_1-default -- cgit v1.1