Skip to content
Permalink
Browse files

Glossary and Rule update: Replacing "non-empty" definition (#430)

  • Loading branch information...
annethyme authored and jkodu committed May 15, 2019
1 parent 1d7899b commit c9a3f5dd61e126b8632714dfc59718f3ab7666b8
@@ -20,7 +20,7 @@ authors:

## Applicability

Any [non-empty](#non-empty) [WAI-ARIA 1.1 state or property](https://www.w3.org/TR/wai-aria-1.1/#state_prop_def) that is specified on an HTML or SVG element.
Any [WAI-ARIA 1.1 state or property](https://www.w3.org/TR/wai-aria-1.1/#state_prop_def) that is not empty (""), and that is specified on an HTML or SVG element.

## Expectation

@@ -19,12 +19,12 @@ authors:

## Applicability

The rule applies to any HTML `input`, `select` and `textarea` element with a [non-empty](#non-empty) `autocomplete` attribute, except if one of the following is true:
The rule applies to any HTML `input`, `select` and `textarea` element with an `autocomplete` attribute that is not empty (""), except if one of the following is true:

- The element is not [visible on the page](#visible-on-the-page), and not [included in the accessibility tree](#included-in-the-accessibility-tree)
- The element is an `input` element with a `type` property of `hidden`, `button`, `submit` or `reset`
- The element has a `disabled` or `aria-disabled="true"` attribute
- The element has `tabindex="-1"` and has a [semantic role](#semantic-role) that is not a [widget](https://www.w3.org/TR/wai-aria-1.1/#widget_roles)
- The element has a `aria-disabled="true"` attribute
- The element is not part of [sequential focus navigation](https://www.w3.org/TR/html/editing.html#sec-sequential-focus-navigation) and has a [semantic role](#semantic-role) that is not a [widget role](https://www.w3.org/TR/wai-aria-1.1/#widget_roles).

## Expectation 1

@@ -124,6 +124,30 @@ Full length autocomplete terms.
<input autocomplete="section-primary shipping work email" />
```

#### Passed example 8

The `input` element does not have a semantic role that is a widget role, but still participates in sequential focus navigation, and has a single autocomplete term.

```html
<input role="none" autocomplete="username" />
```

#### Passed example 9

The `input` element does not participates in sequential focus navigation, but still has a semantic role that is a widget role, and has a single autocomplete term.

```html
<input tabindex="-1" autocomplete="username" />
```

#### Passed example 8

The `input` element does not have a semantic role that is a widget role, but still participates in sequential focus navigation since the [`tabindex` attribute](https://www.w3.org/TR/html/editing.html#the-tabindex-attribute) value is not a [valid integer](https://www.w3.org/TR/html/infrastructure.html#valid-integer), and has a single autocomplete term.

```html
<input role="none" tabindex="-1.5" autocomplete="username" />
```

### Failed

#### Failed Example 1
@@ -136,7 +160,7 @@ Unknown autocomplete term.

#### Failed Example 2

term `work` not allowed before `photo`.
Term `work` not allowed before `photo`.

```html
<input autocomplete="work photo" />
@@ -166,35 +190,43 @@ Autocomplete is inappropriate for the type of field.
<input type="number" autocomplete="email" />
```

#### Failed example 6

Autocomplete is not empty, but does not have any terms specified.

```html
<input autocomplete=" " />
```

### Inapplicable

#### Inapplicable Example 1

Incorrect element.
Inapplicable element.

```html
<button autocomplete="username"></button>
```

#### Inapplicable Example 2

Empty attribute.
Autocomplete attribute is empty ("").

```html
<input autocomplete="" />
```

#### Inapplicable Example 3

Hidden through `display:none`.
The element is hidden through `display:none`.

```html
<input autocomplete="username" style="display:none" />
```

#### Inapplicable Example 4

Off screen and hidden to assistive technologies
The element is positioned off screen and hidden to assistive technologies

```html
<input
@@ -206,40 +238,48 @@ Off screen and hidden to assistive technologies

#### Inapplicable Example 5

type `input` button.
The `input` element has a `type` attribute that is in the `button` state.

```html
<input type="button" autocomplete="username" />
```

#### Inapplicable Example 6

type `hidden`.
The `input` element has a `type` attribute that is in the `hidden` state.

```html
<input type="hidden" autocomplete="username" />
```

#### Inapplicable Example 7

Native disabled.
The `input` element has an HTML `disabled` attribute.

```html
<input autocomplete="username" disabled />
```

#### Inapplicable Example 8

Using `aria-disabled`.
The `input` element has an `aria-disabled` attribute with value `true`.

```html
<input autocomplete="username" aria-disabled="true" />
```

#### Inapplicable Example 9

Non-widget element.
Non-widget element that does not participate in sequential focus navigation.

```html
<input type="button" role="none" tabindex="-1" autocomplete="username" />
```

#### Inapplicable example 10

Non-widget element that does not participate in sequential focus navigation.

```html
<input type="button" role="none" tabindex="-2" autocomplete="username">
```
@@ -24,7 +24,7 @@ The rule applies to elements that are [included in the accessibility tree](#incl

## Expectation

Each target element has an [accessible name](#accessible-name) that is [non-empty](#non-empty)
Each target element has an [accessible name](#accessible-name) that is not only [whitespace](#whitespace).

## Assumptions

@@ -112,6 +112,14 @@ Off screen elements should be tested.
</html>
```

#### Passed example 8

Button has accessible name that is not only whitespace.

```html
<button>:-)</button>
```

### Failed

#### Failed Example 1
@@ -149,6 +157,14 @@ Off screen element without an accessible name.
</html>
```

#### Failed example 4

Button has an accessible name that is not only whitespace.

```html
<button> </button>
```

### Inapplicable

#### Inapplicable Example 1
@@ -29,7 +29,7 @@ This rule applies to any element that is [included in the accessibility tree](#i

## Expectation

Each target element has an [accessible name](#accessible-name) that is [non-empty](#non-empty).
Each target element has an [accessible name](#accessible-name) that is not only [whitespace](#whitespace).

## Assumptions

@@ -97,6 +97,17 @@ Explicit role.
<div aria-label="country" role="combobox" aria-disabled="true">England</div>
```

#### Passed example 6

The accessible name is not only whitespace.

```html
<label>
:-)
<input/>
</label>
```

### Failed

#### Failed Example 1
@@ -109,7 +120,7 @@ No accessible name.

#### Failed Example 2

Non-focusable still need an accessible name.
Non-focusable element still needs an accessible name.

```html
<input tabindex="-1" />
@@ -125,15 +136,15 @@ Non-focusable still need an accessible name.

#### Failed Example 4

Label does not exist.
The label does not exist.

```html
<div aria-labelledby="non-existing" role="combobox">England</div>
```

#### Failed Example 5

Implicit label not supported on div elements.
The implicit label is not supported on `div` elements.

```html
<label>
@@ -144,14 +155,22 @@ Implicit label not supported on div elements.

#### Failed Example 6

Explicit label not supported on div elements.
The explicit label is not supported on `div` elements.

```html
<label for="lastname">first name</label>
<div role="textbox" id="lastname"></div>
```

### Inapplicable
#### Failed example 7

The accessible name is not only whitespace.

```html
<label> <input/></label>
```

### Inapplicable

#### Inapplicable Example 1

@@ -171,7 +190,7 @@ Hidden to assistive technologies.

#### Inapplicable Example 3

Explicitly set the role to something that isn't a form field.
Role has explicitely been set to something that isn't a form field.

```html
<input role="presentation" />
@@ -23,7 +23,7 @@ The root element of the [page](https://www.w3.org/TR/WCAG21/#dfn-web-page-s), if

## Expectation

The test target has a [non-empty](#non-empty) `lang` or `xml:lang` attribute.
The test target has a `lang` or `xml:lang` attribute that is not empty ("").

**Note**: HTML5 recommends using `lang` instead of `xml:lang`. This is not known to impact accessibility, which is why use of both is permitted by this rule.

@@ -97,12 +97,36 @@ The `lang` attribute specified has a non-empty value. The rule does not verify t

#### Passed Example 7

The `xml:lang` attribute specified has a non-empty value. The rule does not verify the validity of the value specified and checks only for presence of a value.
The `xml:lang` attribute specifies a value that is not empty (""). The rule does not verify the validity of the value specified and checks only for presence of a value.

```html
<html xml:lang="xyz"></html>
```

#### Passed example 8

The `xml:lang` attribute specifies a value that is not empty (""). The rule does not verify the validity of the value specified and checks only for presence of a value.

```html
<html xml:lang="123">
```

#### Passed example 9

The `xml:lang` attribute specifies a value that is not empty (""). The rule does not verify the validity of the value specified and checks only for presence of a value.

```html
<html xml:lang="#!">
```

#### Passed example 9

The `xml:lang` attribute specifies a value that is not empty (""). The rule does not verify the validity of the value specified and checks only for presence of a value.

```html
<html xml:lang=" ">
```

### Failed

#### Failed Example 1
@@ -115,23 +139,23 @@ There were no `lang` or `xml:lang` attribute specified.

#### Failed Example 2

The `xml:lang` attribute specified has an empty value.
The `xml:lang` attribute specified is empty ("").

```html
<html xml:lang=""></html>
```

#### Failed Example 3

The `lang` attribute specified has an empty value.
The `lang` attribute specified is empty ("").

```html
<html lang=""></html>
```

#### Failed Example 4

The `lang` and `xml:lang` attribute specified has an empty value.
The `lang` and `xml:lang` attribute specified is empty ("").

```html
<html xml:lang="" lang=""></html>

0 comments on commit c9a3f5d

Please sign in to comment.
You can’t perform that action at this time.