You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _rules/autocomplete-valid-value-73f2c2.md
+25-5Lines changed: 25 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -26,11 +26,11 @@ acknowledgments:
26
26
27
27
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:
28
28
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
+
-<dfnid="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
+
-<dfnid="73f2c2:disabled">disabled</dfn>: the element is a [disabled element]; or
31
+
-<dfnid="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
+
-<dfnid="73f2c2:hidden">hidden</dfn>: the element is not [visible][], and not [included in the accessibility tree][]; or
33
+
-<dfnid="73f2c2:static">static</dfn>: the element is not part of [sequential focus navigation][] and has a [semantic role][] that is not a [widget role][].
34
34
35
35
## Expectation
36
36
@@ -67,6 +67,10 @@ Many browsers provide auto-filling suggestions even when the control's `type` [a
67
67
68
68
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.
69
69
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).
@@ -260,6 +264,22 @@ This `autocomplete` attribute is inapplicable because it has the `off` value.
260
264
<label>Friend's first name<inputtype="text"autocomplete="off"/></label>
261
265
```
262
266
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
+
<inputtype="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.
0 commit comments