-
Notifications
You must be signed in to change notification settings - Fork 21
/
accessible-name-link02.html
66 lines (66 loc) · 3.44 KB
/
accessible-name-link02.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>a where "aria-label" should be accessible name</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="favicon.ico">
<link href="assets/css/examples.css" rel="stylesheet">
</head>
<body>
<h1><code><a></code> where <code>aria-label</code> should be accessible name</h1>
<p>← <a href="index.html">Return to main list</a></p>
<p>The purpose this test is to show the cascade order of how accessible names are applied in the accessibility tree for the <code><a></code> element. The priority order from highest to lowest is:</p>
<ol>
<li><a href="accessible-name-link01.html">If present, use <code>aria-labelledby</code> value.</a></li>
<li><b>Otherwise, if present, use <code>aria-label</code> value (as per the "Dog" below).</b></li>
<li><a href="accessible-name-link03.html">Otherise, if present, use link content.</a></li>
<li><a href="accessible-name-link04.html">Otherwise, if present, use <code>title</code> value</a>.</li>
<li><a href="accessible-name-link05.html">If none of the above are provided, there is no accessible name.</a></li>
</ol>
<p>In examples 1 - 3, the <code>title</code> value of "Rabbit" should be announced as a description rather than a name. This is based on the <a href="https://www.w3.org/TR/html-aam-1.0/#accessible-name-and-description-computation" target="_blank">HTML Accessibility API Mappings 1.0</a> which states that elements should use the <code>aria-describedby</code> attribute for the description if present. If the <code>aria-describedby</code> attribute is not present, the <code>title</code> attribute should be used, as long as this attribute is is not being used as the accessible name.</p>
<p>In example 4, the <code>title</code> value of "Rabbit" should be announced as the accessible name as no other accessible name is provided. As there is no <code>aria-describedby</code> attribute present, the element should not have a description.</p>
<p>This example should not be considered proper practice. Where possible content within the link should be used to define the accessible name.</p>
<h2>Example</h2>
<form action="#">
<div class="form-group">
<a class="button" href="#" aria-label="dog" title="rabbit">Fish</a>
</div>
</form>
<h2>Code</h2>
<!-- start code -->
<pre><code><a
href="#"
aria-label="dog"
title="rabbit"
>
Fish
</a></code></pre>
<!-- end code -->
<h2>Assistive technologies</h2>
<div class="note">
<h3>VoiceOver</h3>
<ul class="browser-list">
<li><b>Chrome:</b> Link. <span class="green">Dog</span>. Rabbit</li>
<li><b>Firefox:</b> Link. <span class="green">Dog</span>. Rabbit</li>
</ul>
</div>
<div class="note">
<h3>NVDA</h3>
<ul class="browser-list">
<li><b>Chrome:</b> <span class="green">Dog</span>. Link. Rabbit.</li>
<li><b>Firefox:</b> <span class="green">Dog</span>. Link. Rabbit.</li>
<li><b>Edge:</b> <span class="green">Dog</span>. Link. Rabbit.</li>
</ul>
</div>
<div class="note">
<h3>JAWS</h3>
<ul class="browser-list">
<li><b>Chrome:</b> <span class="green">Dog</span>. Link. Rabbit.</li>
<li><b>Firefox:</b> <span class="green">Dog</span>. Link. Rabbit.</li>
<li><b>Edge:</b> <span class="green">Dog</span>. Link. Rabbit.</li>
</ul>
</div>
<p>← <a href="index.html">Return to main list</a></p>
</body>
</html>