Skip to content

Commit d4f8076

Browse files
adding failed example to emphasize that a word in the middle will cause a rule failure.
1 parent ae2273a commit d4f8076

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

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

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,55 +301,63 @@ This button's accessible name contains the same tokens that are in the visible l
301301
<button aria-label="how are you"><span>you</span><span>how</span><span>are</span></button>
302302
```
303303

304-
#### Failed Example 11
304+
#### Failed Example 11
305+
306+
This button's accessible name contains the word "the" in the middle of it, which causes the sublist check of the [label in name algorithm][] (in particular: the "consecutive" requirement of that check) to fail. So it fails the rule.
307+
308+
```html
309+
<button aria-label="Download the specification">Download specification</button>
310+
```
311+
312+
#### Failed Example 12
305313

306314
This link's accessible name contains the same digits that are in the visible label, and in the same order. But they have different spaces and punctuation between them, so they are considered separate tokens. So this fails the rule.
307315

308316
```html
309317
<a aria-label="1 2 3. 4 5 6. 7 8 9 0" href="tel:1234567890">123.456.7890</a>
310318
```
311319

312-
#### Failed Example 12
320+
#### Failed Example 13
313321

314322
This rule has no special handling which tries to guess when number have the same semantic meaning. It operates on tokens only.
315323

316324
```html
317325
<a href="#2021" aria-label="20 21">2021</a>
318326
```
319327

320-
#### Failed Example 13
328+
#### Failed Example 14
321329

322330
Similar to the previous example.
323331

324332
```html
325333
<a aria-label="fibonacci: 0 1 1 2 3 5 8 13 21 34">fibonacci: 0112358132134</a>
326334
```
327335

328-
#### Failed Example 14
336+
#### Failed Example 15
329337

330338
This rule has no special handling for converting digits into words, or vice versa.
331339

332340
```html
333341
<a href="#2021" aria-label="twenty twenty-one">two thousand twenty-one</a>
334342
```
335343

336-
#### Failed Example 15
344+
#### Failed Example 16
337345

338346
(Same as above.) This rule has no special handling for converting digits into words, or vice versa.
339347

340348
```html
341349
<a aria-label="two zero two three" href="#">2 0 2 3</a>
342350
```
343351

344-
#### Failed Example 16
352+
#### Failed Example 17
345353

346354
This rule has no special handling for digits that appear next to letters with no spaces in between.
347355

348356
```html
349357
<a aria-label="1a" href="#">1</a>
350358
```
351359

352-
#### Failed Example 17
360+
#### Failed Example 18
353361

354362
The definition of [visible inner text][] doesn't treat text any differently if it's excluded from the accessibility tree with aria-hidden. So this rule effectively ignores aria-hidden. So this element fails the rule.
355363

0 commit comments

Comments
 (0)