Commit f7cde89d authored by isherman@chromium.org's avatar isherman@chromium.org

Update recognized 'autocompletetype' tokens with the most recent values from the spec.

BUG=92121
TEST=browser_tests --gtest_filter=FormStructureBrowserTest.DataDrivenHeuristics01


Review URL: http://codereview.chromium.org/7639010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96563 0039d316-1c4b-4281-b951-d872f2087c98
parent cc99db6d
...@@ -126,12 +126,16 @@ bool ConvertToAutofillFieldType(const AutofillField& field, ...@@ -126,12 +126,16 @@ bool ConvertToAutofillFieldType(const AutofillField& field,
return true; return true;
} }
if (autocomplete_type == ASCIIToUTF16("locality")) { if (autocomplete_type == ASCIIToUTF16("locality") ||
autocomplete_type == ASCIIToUTF16("city")) {
*autofill_type = ADDRESS_HOME_CITY; *autofill_type = ADDRESS_HOME_CITY;
return true; return true;
} }
if (autocomplete_type == ASCIIToUTF16("administrative-area")) { if (autocomplete_type == ASCIIToUTF16("administrative-area") ||
autocomplete_type == ASCIIToUTF16("state") ||
autocomplete_type == ASCIIToUTF16("province") ||
autocomplete_type == ASCIIToUTF16("region")) {
*autofill_type = ADDRESS_HOME_STATE; *autofill_type = ADDRESS_HOME_STATE;
return true; return true;
} }
...@@ -166,12 +170,21 @@ bool ConvertToAutofillFieldType(const AutofillField& field, ...@@ -166,12 +170,21 @@ bool ConvertToAutofillFieldType(const AutofillField& field,
return true; return true;
} }
if (autocomplete_type == ASCIIToUTF16("phone-city-code")) { if (autocomplete_type == ASCIIToUTF16("phone-national")) {
*autofill_type = PHONE_HOME_CITY_AND_NUMBER;
return true;
}
if (autocomplete_type == ASCIIToUTF16("phone-area-code")) {
*autofill_type = PHONE_HOME_CITY_CODE; *autofill_type = PHONE_HOME_CITY_CODE;
return true; return true;
} }
if (autocomplete_type == ASCIIToUTF16("phone-number")) { // TODO(isherman): We should more fully support "phone-local-prefix" and
// "phone-local-suffix": http://crbug.com/92121
if (autocomplete_type == ASCIIToUTF16("phone-local") ||
autocomplete_type == ASCIIToUTF16("phone-local-prefix") ||
autocomplete_type == ASCIIToUTF16("phone-local-suffix")) {
*autofill_type = PHONE_HOME_NUMBER; *autofill_type = PHONE_HOME_NUMBER;
return true; return true;
} }
...@@ -186,12 +199,21 @@ bool ConvertToAutofillFieldType(const AutofillField& field, ...@@ -186,12 +199,21 @@ bool ConvertToAutofillFieldType(const AutofillField& field,
return true; return true;
} }
if (autocomplete_type == ASCIIToUTF16("fax-city-code")) { if (autocomplete_type == ASCIIToUTF16("fax-national")) {
*autofill_type = PHONE_FAX_CITY_AND_NUMBER;
return true;
}
if (autocomplete_type == ASCIIToUTF16("fax-area-code")) {
*autofill_type = PHONE_FAX_CITY_CODE; *autofill_type = PHONE_FAX_CITY_CODE;
return true; return true;
} }
if (autocomplete_type == ASCIIToUTF16("fax-number")) { // TODO(isherman): We should more fully support "fax-local-prefix" and
// "fax-local-suffix": http://crbug.com/92121
if (autocomplete_type == ASCIIToUTF16("fax-local") ||
autocomplete_type == ASCIIToUTF16("fax-local-prefix") ||
autocomplete_type == ASCIIToUTF16("fax-local-suffix")) {
*autofill_type = PHONE_FAX_NUMBER; *autofill_type = PHONE_FAX_NUMBER;
return true; return true;
} }
......
...@@ -8,18 +8,29 @@ ...@@ -8,18 +8,29 @@
<input type="text" id="af" x-autocompletetype="street-address"><br> <input type="text" id="af" x-autocompletetype="street-address"><br>
<input type="text" id="a1" x-autocompletetype="address-line1"><br> <input type="text" id="a1" x-autocompletetype="address-line1"><br>
<input type="text" id="a2" x-autocompletetype="address-line2"><br> <input type="text" id="a2" x-autocompletetype="address-line2"><br>
<input type="text" id="ct" x-autocompletetype="locality"><br> <input type="text" id="l1" x-autocompletetype="locality"><br>
<input type="text" id="l2" x-autocompletetype="city"><br>
<input type="text" id="s1" x-autocompletetype="administrative-area"><br>
<input type="text" id="s2" x-autocompletetype="state"><br>
<input type="text" id="s3" x-autocompletetype="province"><br>
<input type="text" id="s4" x-autocompletetype="region"><br>
<input type="text" id="zc" x-autocompletetype="postal-code"><br> <input type="text" id="zc" x-autocompletetype="postal-code"><br>
<input type="text" id="st" x-autocompletetype="administrative-area"><br> <input type="text" id="cy" x-autocompletetype="country"><br>
<input type="text" id="em" x-autocompletetype="email"><br> <input type="text" id="em" x-autocompletetype="email"><br>
<input type="text" id="pf" x-autocompletetype="phone-full"><br> <input type="text" id="p1" x-autocompletetype="phone-full"><br>
<input type="text" id="pc" x-autocompletetype="phone-country-code"><br> <input type="text" id="p2" x-autocompletetype="phone-country-code"><br>
<input type="text" id="pa" x-autocompletetype="phone-city-code"><br> <input type="text" id="p3" x-autocompletetype="phone-national"><br>
<input type="text" id="pn" x-autocompletetype="phone-number"><br> <input type="text" id="p4" x-autocompletetype="phone-area-code"><br>
<input type="text" id="ff" x-autocompletetype="fax-full"><br> <input type="text" id="p5" x-autocompletetype="phone-local"><br>
<input type="text" id="fc" x-autocompletetype="fax-country-code"><br> <input type="text" id="p6" x-autocompletetype="phone-local-prefix"><br>
<input type="text" id="fa" x-autocompletetype="fax-city-code"><br> <input type="text" id="p7" x-autocompletetype="phone-local-suffix"><br>
<input type="text" id="fx" x-autocompletetype="fax-number"><br> <input type="text" id="f1" x-autocompletetype="fax-full"><br>
<input type="text" id="f2" x-autocompletetype="fax-country-code"><br>
<input type="text" id="f3" x-autocompletetype="fax-national"><br>
<input type="text" id="f4" x-autocompletetype="fax-area-code"><br>
<input type="text" id="f5" x-autocompletetype="fax-local"><br>
<input type="text" id="f6" x-autocompletetype="fax-local-prefix"><br>
<input type="text" id="f7" x-autocompletetype="fax-local-suffix"><br>
<input type="text" id="c1" x-autocompletetype="cc-full-name"><br> <input type="text" id="c1" x-autocompletetype="cc-full-name"><br>
<input type="text" id="c2" x-autocompletetype="cc-number"><br> <input type="text" id="c2" x-autocompletetype="cc-number"><br>
<input type="text" id="c3" x-autocompletetype="cc-exp-month"><br> <input type="text" id="c3" x-autocompletetype="cc-exp-month"><br>
......
...@@ -7,18 +7,29 @@ COMPANY_NAME | cm | | ...@@ -7,18 +7,29 @@ COMPANY_NAME | cm | |
ADDRESS_HOME_LINE1 | af | | ADDRESS_HOME_LINE1 | af | |
ADDRESS_HOME_LINE1 | a1 | | ADDRESS_HOME_LINE1 | a1 | |
ADDRESS_HOME_LINE2 | a2 | | ADDRESS_HOME_LINE2 | a2 | |
ADDRESS_HOME_CITY | ct | | ADDRESS_HOME_CITY | l1 | |
ADDRESS_HOME_CITY | l2 | |
ADDRESS_HOME_STATE | s1 | |
ADDRESS_HOME_STATE | s2 | |
ADDRESS_HOME_STATE | s3 | |
ADDRESS_HOME_STATE | s4 | |
ADDRESS_HOME_ZIP | zc | | ADDRESS_HOME_ZIP | zc | |
ADDRESS_HOME_STATE | st | | ADDRESS_HOME_COUNTRY | cy | |
EMAIL_ADDRESS | em | | EMAIL_ADDRESS | em | |
PHONE_HOME_WHOLE_NUMBER | pf | | PHONE_HOME_WHOLE_NUMBER | p1 | |
PHONE_HOME_COUNTRY_CODE | pc | | PHONE_HOME_COUNTRY_CODE | p2 | |
PHONE_HOME_CITY_CODE | pa | | PHONE_HOME_CITY_AND_NUMBER | p3 | |
PHONE_HOME_NUMBER | pn | | PHONE_HOME_CITY_CODE | p4 | |
PHONE_FAX_WHOLE_NUMBER | ff | | PHONE_HOME_NUMBER | p5 | |
PHONE_FAX_COUNTRY_CODE | fc | | PHONE_HOME_NUMBER | p6 | |
PHONE_FAX_CITY_CODE | fa | | PHONE_HOME_NUMBER | p7 | |
PHONE_FAX_NUMBER | fx | | PHONE_FAX_WHOLE_NUMBER | f1 | |
PHONE_FAX_COUNTRY_CODE | f2 | |
PHONE_FAX_CITY_AND_NUMBER | f3 | |
PHONE_FAX_CITY_CODE | f4 | |
PHONE_FAX_NUMBER | f5 | |
PHONE_FAX_NUMBER | f6 | |
PHONE_FAX_NUMBER | f7 | |
CREDIT_CARD_NAME | c1 | | CREDIT_CARD_NAME | c1 | |
CREDIT_CARD_NUMBER | c2 | | CREDIT_CARD_NUMBER | c2 | |
CREDIT_CARD_EXP_MONTH | c3 | | CREDIT_CARD_EXP_MONTH | c3 | |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment