Skip to content

Commit 2531671

Browse files
giacomo-petriHelenBurgeJym77Carlos Duarte
authored
Update autocomplete-valid-value-73f2c2.md (#1907)
* Update autocomplete-valid-value-73f2c2.md * Update autocomplete-valid-value-73f2c2.md * Update _rules/autocomplete-valid-value-73f2c2.md Co-authored-by: HelenBurge <41951878+HelenBurge@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com> * Update autocomplete-valid-value-73f2c2.md * Update autocomplete-valid-value-73f2c2.md --------- Co-authored-by: HelenBurge <41951878+HelenBurge@users.noreply.github.com> Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com> Co-authored-by: Carlos Duarte <caduarte@campus.ul.pt>
1 parent 9bad856 commit 2531671

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

_rules/autocomplete-valid-value-73f2c2.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ acknowledgments:
2626

2727
This rule applies to any [HTML][] `input`, `select` and `textarea` element with an `autocomplete` [attribute value][] that is neither empty (`""`) nor only [ASCII whitespace][], except if one or more of the following is true:
2828

29-
- **toggle**: the `autocomplete` attribute consists of a single token that is an [ASCII case-insensitive][] match for the string `off` or the string `on`; or
30-
- **disabled**: the element is a [disabled element]; or
31-
- **fixed value**: the element is an `input` element with a `type` [attribute value][] of `hidden`, `button`, `submit` or `reset`; or
32-
- **hidden**: the element is not [visible][], and not [included in the accessibility tree][]; or
33-
- **static**: the element is not part of [sequential focus navigation][] and has a [semantic role][] that is not a [widget role][].
29+
- <dfn id="73f2c2:toggle">toggle</dfn>: the `autocomplete` attribute consists of a single token that is an [ASCII case-insensitive][] match for the string `off` or the string `on`; or
30+
- <dfn id="73f2c2:disabled">disabled</dfn>: the element is a [disabled element]; or
31+
- <dfn id="73f2c2:fixed-value">fixed value</dfn>: the element is an `input` element with a `type` [attribute value][] of `button`, `checkbox`, `file`, `image`, `radio`, `reset` or `submit`; or
32+
- <dfn id="73f2c2:hidden">hidden</dfn>: the element is not [visible][], and not [included in the accessibility tree][]; or
33+
- <dfn id="73f2c2:static">static</dfn>: the element is not part of [sequential focus navigation][] and has a [semantic role][] that is not a [widget role][].
3434

3535
## Expectation
3636

@@ -67,6 +67,10 @@ Many browsers provide auto-filling suggestions even when the control's `type` [a
6767

6868
The auto-completing feature of the `autocomplete` attribute benefits many users, but it is not required to satisfy success Criterion [1.3.5 Identify Input Purpose][sc135]. Setting `autocomplete="off"` on the element's [form owner](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-owner) prevents the user agent from completing it, but it does not prevent the `autocomplete` [attribute value][] from being programmatically identifiable.
6969

70+
The [fixed value](#73f2c2:fixed-value) condition in the Applicability is excluding `input` elements who do not consider the `autocomplete` attribute, based on their `type` [attribute value][]; `input` elements with a `type` [attribute value][] of `hidden` are excluded by the [hidden](#73f2c2:hidden) condition.
71+
72+
On an `input` element with a `type` [attribute value][] of `hidden`, the autocomplete attribute wears the [autofill anchor mantle](https://html.spec.whatwg.org/#autofill-anchor-mantle), describing the meaning of the given value. In all other cases, it wears the [autofill expectation mantle](https://html.spec.whatwg.org/#autofill-expectation-mantle).
73+
7074
### Bibliography
7175

7276
- [Understanding Success Criterion 1.3.5: Identify Input Purpose](https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html)
@@ -260,6 +264,22 @@ This `autocomplete` attribute is inapplicable because it has the `off` value.
260264
<label>Friend's first name<input type="text" autocomplete="off"/></label>
261265
```
262266

267+
#### Inapplicable Example 8
268+
269+
This `input` element has a [fixed value](#73f2c2:fixed-value) due to its `type` [attribute value][] of `submit`. `autocomplete` does not apply to Submit buttons.
270+
271+
```html
272+
<input type="submit" autocomplete="email"/>
273+
```
274+
275+
#### Inapplicable Example 9
276+
277+
This `input` element is [hidden](#73f2c2:hidden) because of its `type` [attribute value][] of `hidden` (following standard [User Agent style sheet recommendations](https://html.spec.whatwg.org/multipage/rendering.html#hidden-elements). Knowing the transaction amount may still be used in other fields, e.g. to suggest a card with sufficient balance; this is not tested by this rule.
278+
279+
```html
280+
<input type="hidden" autocomplete="transaction-amount" value="100.00">
281+
```
282+
263283
[ascii whitespace]: https://infra.spec.whatwg.org/#ascii-whitespace 'HTML ASCII whitespace 2020/08/12'
264284
[ascii case-insensitive]: https://infra.spec.whatwg.org/#ascii-case-insensitive 'definition of ASCII case-insensitive'
265285
[attribute value]: #attribute-value 'Definition of Attribute Value'

0 commit comments

Comments
 (0)