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/visible-label-in-accessible-name-2ee8b8.md
+20-3Lines changed: 20 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ This rule applies to any element for which all the following is true:
38
38
39
39
## Expectation
40
40
41
-
For each target element, all [text nodes][] in the [visible text content][]either match or are contained within the [accessible name][] of this target element, except for characters in the [text nodes][] used to express [non-text content][]. Leading and trailing [whitespace][] and difference in case sensitivity should be ignored.
41
+
For each target element, all [text nodes][] in the [visible text content][][match characters][] and are contained within the [accessible name][] of this target element, except for characters in the [text nodes][] used to express [non-text content][]. Leading and trailing [whitespace][] and difference in case sensitivity should be ignored.
42
42
43
43
## Assumptions
44
44
@@ -97,10 +97,10 @@ This button has [visible][] text that is contained within the [accessible name][
97
97
98
98
#### Passed Example 5
99
99
100
-
This button has [visible][] text that does not need to be contained within the [accessible name][], because the "x" text node is [non-text content][].
100
+
This button has [visible][] text that does not need to be contained within the [accessible name][], because the "x" text node is [non-text content][]. Note: this would need to meet SC 1.1.1 Non text content.
101
101
102
102
```html
103
-
<buttonaria-label="close">X</button>
103
+
<buttonaria-label="anything">X</button>
104
104
```
105
105
106
106
#### Passed Example 6
@@ -143,6 +143,22 @@ This link has [visible][] text with mathematical symbols, that does not match th
143
143
<ahref="/"aria-label="Proof of two multiplied by two is four">Proof of 2×2=4</a>
144
144
```
145
145
146
+
#### Failed Example 4
147
+
148
+
This link has [visible][] text does not match the [accessible name][] because there is a hyphen in the accessible name.
0 commit comments