Implement support for the autocomplete attribute
authorjhoneycutt@apple.com <jhoneycutt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 22:51:52 +0000 (22:51 +0000)
committerjhoneycutt@apple.com <jhoneycutt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 22:51:52 +0000 (22:51 +0000)
commit9096f16b765ea976f789d1c93adee79305e24ca9
tree3f17efb4296f35e052ea079c2a5507e0926f65a6
parent57b5c016b04e9acd4b74c39a67b0d6513cdc2648
Implement support for the autocomplete attribute
https://bugs.webkit.org/show_bug.cgi?id=150731
rdar://problem/21078968

LayoutTests/imported/w3c:

Reviewed by Brent Fulgham.

* web-platform-tests/html/dom/interfaces-expected.txt: Rebased.
* web-platform-tests/html/semantics/forms/the-form-element/form-autocomplete-expected.txt:
Rebased.

Source/WebCore:

The autocomplete attribute is defined by
https://html.spec.whatwg.org/multipage/forms.html#autofill.

Reviewed by Brent Fulgham.

Test: fast/forms/autocomplete-tokens.html

* html/HTMLFormControlElement.cpp:
(WebCore::isContactToken):
Return true if this is a contact token.
(WebCore::categoryForAutofillFieldToken):
Adds all of the autofill field tokens to a map, and returns the
category for a given token.
(WebCore::maxTokensForAutofillFieldCategory):
Return the maximum number of tokens an autofill category supports.
(WebCore::HTMLFormControlElement::parseAutocompleteAttribute):
Implement the processing model defined in
https://html.spec.whatwg.org/multipage/forms.html#processing-model-3
with respect to the IDL-exposed autofill value.
(WebCore::HTMLFormControlElement::setAutocomplete):
Set the autocomplete attribute to the given string.

* html/HTMLFormControlElement.h:
Declare setAutocomplete() and autocomplete().

* html/HTMLInputElement.idl:
Remove the Reflect attribute. We now have custom processing for getting
this attribute.

* html/HTMLSelectElement.idl:
Declare the autocomplete attribute.

* html/HTMLTextAreaElement.idl:
Ditto.

LayoutTests:

Reviewed by Brent Fulgham.

* fast/forms/autocomplete-tokens-expected.txt: Added.
* fast/forms/autocomplete-tokens.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/autocomplete-tokens-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/autocomplete-tokens.html [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-autocomplete-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLInputElement.idl
Source/WebCore/html/HTMLSelectElement.idl
Source/WebCore/html/HTMLTextAreaElement.idl