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
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,14 @@ The [visible inner text][] is "Download specification". The words "the" and "gi
149
149
150
150
#### Passed Example 10
151
151
152
+
The [visible inner text][] is "Download specification", which includes a space character between the two words due to the second clause of the definition of [visible inner text of a text node][].
This example shows that the [visible inner text][] isn't always the same as the [innerText][https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute]. The visible inner text is "Download specification". The innerText is 'Download \ngizmo\nspecification'. This rule uses the visible inner text - not innerText.
153
161
154
162
```html
@@ -166,31 +174,31 @@ This example shows that the [visible inner text][] isn't always the same as the
This example passes the rule because "YYYY-MM-DD" is in brackets. Text in brackets is removed by the [label in name algorithm][], because its not normally spoken by speech-input users.
180
188
181
189
```html
182
190
<buttonaria-label="Search by date">Search by date (YYYY-MM-DD)</button>
183
191
```
184
192
185
-
#### Passed Example 13
193
+
#### Passed Example 14
186
194
187
195
The passes for two reasons: 1) because the ellipsis ("…") is [non-text content][], and 2) because the ellipsis is neither a letter nor a digit and so is filtered out by the [label in name algorithm][].
188
196
189
197
```html
190
198
<buttonaria-label="Next">Next…</button>
191
199
```
192
200
193
-
#### Passed Example 14
201
+
#### Passed Example 15
194
202
195
203
This passes because the [label in name algorithm][] effectively ignores all punctuation and emoji, in both the visible inner text and the accessible name, as long as they don't break up words.
196
204
@@ -383,6 +391,7 @@ This link has no [visible inner text][].
383
391
[supports name from content]: https://www.w3.org/TR/wai-aria-1.1/#namefromcontent'Definition of Supports name from contents'
384
392
[visible]: #visible'Definition of visible'
385
393
[visible inner text]: #visible-inner-text'Definition of Visible inner text'
394
+
[visible inner text of a text node]: #visible-inner-text:for-text'Definition of Visible inner text of a text node'
386
395
[visible text content]: #visible-text-content'Definition of Visible text content'
387
396
[whitespace]: #whitespace'Definition of Whitespace'
388
397
[widget role]: https://www.w3.org/TR/wai-aria-1.1/#widget_roles'Definition of Widget role'
0 commit comments