New issue
Advanced search Search tips

Issue 758074 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 26
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Correct 'autocomplete' IDL attribute getter

Project Member Reported by tkent@chromium.org, Aug 23 2017

Issue description

Chrome Version: 62 canary
OS: All but iOS

What steps will reproduce the problem?
(1) open the following URL:
    data:text/html;charset=utf-8,<input%20autocomplete="foo"><script>alert(document.querySelector('input').autocomplete);</script>

What is the expected result?
A dialog with an empty string is opened.

What happens instead?
A dialog with "foo" is opened.

Please use labels and text to provide additional information.
Safari and Firefox work correctly.

Spec: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#idl-exposed-autofill-value
WPT: http://w3c-test.org/html/semantics/forms/the-form-element/form-autocomplete.html

 

Comment 1 by tkent@chromium.org, Aug 23 2017

It seems only Safari implemented the correct behavior.
https://wptdashboard.appspot.com/html/semantics/forms/the-form-element/form-autocomplete.html

Comment 2 by tkent@chromium.org, Aug 23 2017

Components: UI>Browser>Autofill

Comment 3 by ma...@chromium.org, May 1 2018

Status: Untriaged (was: Available)

Comment 4 by tkent@chromium.org, Jun 13 2018

We already have a parser of autocomplete attribute; autofill::FormStructure::ParseFieldTypesFromAutocompleteAttributes
I wonder if Blink can reuse it to implement the correct autocomplete IDL attribute.

Owner: tkent@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 6 by bugdroid1@chromium.org, Sep 26

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c3107f76982e89d98079afcc459c65a43ebed6dd

commit c3107f76982e89d98079afcc459c65a43ebed6dd
Author: Kent Tamura <tkent@chromium.org>
Date: Wed Sep 26 02:40:35 2018

Forms: Fix 'autocomplete' IDL attribute getter.

This CL implements 'IDL-exposed autofill value' in the algorithm [1] for
'autocomplete' IDL attribute getters of INPUT, TEXTAREA, and SELECT.

The new behavior is interoperable with Firefox and Safari.

[1] https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-processing-model

Bug:  758074 
Change-Id: I44e081f50903204d3041cfe7a938ba4a4695e625
Reviewed-on: https://chromium-review.googlesource.com/1242765
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594195}
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete-expected.txt
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete.html
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null-expected.txt
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null.html
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/WebKit/LayoutTests/fast/forms/autocomplete-expected.txt
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/WebKit/LayoutTests/fast/forms/autocomplete.html
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.cc
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.h
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/blink/renderer/core/html/forms/html_input_element.idl
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/blink/renderer/core/html/forms/html_select_element.idl
[modify] https://crrev.com/c3107f76982e89d98079afcc459c65a43ebed6dd/third_party/blink/renderer/core/html/forms/html_text_area_element.idl

Project Member

Comment 7 by bugdroid1@chromium.org, Sep 26

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4d2aeef0b85dc360b7da230d5b270b157c2f3402

commit 4d2aeef0b85dc360b7da230d5b270b157c2f3402
Author: Kent Tamura <tkent@chromium.org>
Date: Wed Sep 26 07:03:28 2018

html: Fix form-autocomplete.html

It has incorrect test cases.
They expected 'autocomplete' IDL attribute getter for <input> without
autocomplete content attribute returned 'autofill field name' instead of
'IDL-exposed autofill value'.

These updated tests pass on Chrome, Firefox, and Safari.

Specification: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-processing-model

Bug:  758074 
Change-Id: I9f7469d2e2dbf91012fe0f7eddedd0d024e6b120
Reviewed-on: https://chromium-review.googlesource.com/1245018
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594234}
[delete] https://crrev.com/e5a1962b581e69d440d82c6d8c81cf9f31ae8d84/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete-expected.txt
[modify] https://crrev.com/4d2aeef0b85dc360b7da230d5b270b157c2f3402/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete.html

Labels: Target-71
Status: Fixed (was: Started)
This is a great step forward but it would be much better to only support values that the browser does anything meaningful with in order to support feature detection, like Firefox does. Many values like 'sex', 'impp', etc. aren't supported.

If no implementations support a value it could also be considered for removal from HTML.

Sign in to add a comment