Skip to content

Commit b2df021

Browse files
adding passed example due to review at act-rules#2075 (comment)
1 parent 5220766 commit b2df021

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

_rules/visible-label-in-accessible-name-2ee8b8.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ The [visible inner text][] is "Download specification". The words "the" and "gi
149149

150150
#### Passed Example 10
151151

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][].
153+
154+
```html
155+
<a aria-label="Download specification" href="#"><span>Download</span><span id="space"> </span><span>specification</span></a>
156+
```
157+
158+
#### Passed Example 11
159+
152160
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.
153161

154162
```html
@@ -166,31 +174,31 @@ This example shows that the [visible inner text][] isn't always the same as the
166174
<a aria-label="Download specification" href="#">Download <span class="visually-hidden">gizmo</span> specification</a>
167175
```
168176

169-
#### Passed Example 11
177+
#### Passed Example 12
170178

171179
This example shows that the [label in name algorithm][] handles many kinds of whitespace.
172180

173181
```html
174182
<a aria-label="compose email" href="#">compose &nbsp;&nbsp;<br> email</a>
175183
```
176184

177-
#### Passed Example 12
185+
#### Passed Example 13
178186

179187
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.
180188

181189
```html
182190
<button aria-label="Search by date">Search by date (YYYY-MM-DD)</button>
183191
```
184192

185-
#### Passed Example 13
193+
#### Passed Example 14
186194

187195
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][].
188196

189197
```html
190198
<button aria-label="Next">Next…</button>
191199
```
192200

193-
#### Passed Example 14
201+
#### Passed Example 15
194202

195203
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.
196204

@@ -383,6 +391,7 @@ This link has no [visible inner text][].
383391
[supports name from content]: https://www.w3.org/TR/wai-aria-1.1/#namefromcontent 'Definition of Supports name from contents'
384392
[visible]: #visible 'Definition of visible'
385393
[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'
386395
[visible text content]: #visible-text-content 'Definition of Visible text content'
387396
[whitespace]: #whitespace 'Definition of Whitespace'
388397
[widget role]: https://www.w3.org/TR/wai-aria-1.1/#widget_roles 'Definition of Widget role'

0 commit comments

Comments
 (0)