Update web-platform-tests to revision 36634cbcf3253dfe8d220990a27ad4eeebf8ec2f

This commit is contained in:
WPT Sync Bot 2018-09-27 21:57:09 -04:00
parent 0964d055cd
commit 7295abcc2a
245 changed files with 5966 additions and 1901 deletions

View file

@ -42,10 +42,10 @@
}, desc);
}
autocompletetest(document.forms.missing_attribute, ["on", "on", "on", "off", ""], "form autocomplete attribute missing");
autocompletetest(document.forms.autocomplete_on, ["on", "on", "on", "off", ""], "form autocomplete attribute on");
autocompletetest(document.forms.autocomplete_off, ["off", "off", "on", "off", ""], "form autocomplete attribute off");
autocompletetest(document.forms.autocomplete_invalid, ["on", "on", "on", "off", ""], "form autocomplete attribute invalid");
autocompletetest(document.forms.missing_attribute, ["on", "", "on", "off", ""], "form autocomplete attribute missing");
autocompletetest(document.forms.autocomplete_on, ["on", "", "on", "off", ""], "form autocomplete attribute on");
autocompletetest(document.forms.autocomplete_off, ["off", "", "on", "off", ""], "form autocomplete attribute off");
autocompletetest(document.forms.autocomplete_invalid, ["on", "", "on", "off", ""], "form autocomplete attribute invalid");
var keywords = [ "on", "off", "name", "honorific-prefix", "given-name", "additional-name", "family-name", "honorific-suffix", "nickname", "username", "new-password", "current-password", "organization-title", "organization", "street-address", "address-line1", "address-line2", "address-line3", "address-level4", "address-level3", "address-level2", "address-level1", "country", "country-name", "postal-code", "cc-name", "cc-given-name", "cc-additional-name", "cc-family-name", "cc-number", "cc-exp", "cc-exp-month", "cc-exp-year", "cc-csc", "cc-type", "transaction-currency", "transaction-amount", "language", "bday", "bday-day", "bday-month", "bday-year", "sex", "url", "photo", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-local-prefix", "tel-local-suffix", "tel-extension", "email", "impp" ];
@ -58,4 +58,59 @@
assert_equals(input.autocomplete, keyword);
}, keyword + " is an allowed autocomplete field name");
});
test(() => {
const select = document.createElement("select");
select.setAttribute("autocomplete", " \n");
assert_equals(select.autocomplete, "");
}, "Test whitespace-only attribute value");
test(() => {
const select = document.createElement("select");
select.setAttribute("autocomplete", "foo off");
assert_equals(select.autocomplete, "");
// Normal category; max=3
select.setAttribute("autocomplete", "foo section-foo billing name");
assert_equals(select.autocomplete, "");
// Contact category; max=4
select.setAttribute("autocomplete", "foo section-bar billing work name");
assert_equals(select.autocomplete, "");
}, "Test maximum number of tokens");
test(() => {
const textarea = document.createElement("textarea");
textarea.setAttribute("autocomplete", "call-sign");
assert_equals(textarea.autocomplete, "");
}, "Unknown field");
test(() => {
const hidden = document.createElement("input");
hidden.type = "hidden";
hidden.setAttribute("autocomplete", "on");
assert_equals(hidden.autocomplete, "");
hidden.setAttribute("autocomplete", "off");
assert_equals(hidden.autocomplete, "");
}, "Test 'wearing the autofill anchor mantle' with off/on");
test(() => {
const textarea = document.createElement("textarea");
textarea.setAttribute("autocomplete", " HOME\ntel");
assert_equals(textarea.autocomplete, "home tel");
textarea.setAttribute("autocomplete", "shipping country");
assert_equals(textarea.autocomplete, "shipping country");
textarea.setAttribute("autocomplete", "billing work email");
assert_equals(textarea.autocomplete, "billing work email");
textarea.setAttribute("autocomplete", " section-FOO bday");
assert_equals(textarea.autocomplete, "section-foo bday");
}, "Serialize combinations of section, mode, contact, and field");
</script>