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: accname/name/comp_labelledby.html
+88Lines changed: 88 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@
21
21
- /accname/name/shadowdom/*
22
22
23
23
-->
24
+
<h2>Tests for <code>aria-labelledby</code></h2>
24
25
25
26
<divrole="group" aria-labelledby="h" class="ex" data-expectedlabel="first heading" data-testname="div group explicitly labelledby heading">
26
27
<h2id="h">first heading</h2>
@@ -36,6 +37,93 @@ <h2 id="h2">+ first heading</h2>
36
37
<spanid="s1">verify</span><spanid="s2">spaces</span><span>FAIL IF INCLUDED</span><spanid="s3">between</span><spanid="s4">foreach</span>
37
38
</nav>
38
39
40
+
<h2>Tests for <code>aria-labeledby</code> (non-standard spelling)</h2>
41
+
42
+
<spanid="n1">first label</span>
43
+
<spanid="n2">second label</span>
44
+
45
+
<ahref="#" aria-labeledby="n1" class="ex" data-expectedlabel="first label" data-testname="link is labelled by aria-labeledby (non-standard spelling)">x</a>
46
+
<buttonaria-labeledby="n1" class="ex" data-expectedlabel="first label" data-testname="button is labelled by aria-labeledby (non-standard spelling)">x</button>
47
+
<divrole="group" aria-labeledby="n1" class="ex" data-expectedlabel="first label" data-testname="div with role group is labelled by aria-labeledby (non-standard spelling)">x</div>
48
+
49
+
<h2>Tests for precedence: <code>aria-labelledby</code> vs. <code>aria-labeledby</code> (non-standard spelling)</h2>
50
+
<!-- The "aria-labelledby" spelling should take precedence over "aria-labeledby" for accname -->
<buttonaria-labeledby="span4" aria-label="foo" data-expectedlabel="foo" data-testname="button's hidden referenced name (visibility:hidden) with hidden aria-labeledby traversal falls back to aria-label" class="ex">
<inputtype="text" id="input1" aria-labeledby="n2" data-expectedlabel="second label" data-testname="input with label for association is superceded by aria-labeledby (non-standard spelling)" class="ex" />
102
+
103
+
<!-- Step 2F: Name From Content is superceded by 2B: AriaLabeledby -->
104
+
<buttonaria-labeledby="n2" data-expectedlabel="second label" data-testname="button name from contents is superceded by aria-labeledby (non-standard spelling)" class="ex">x</button>
105
+
106
+
<!-- Step 2G: Text Node is superceded by 2B: AriaLabeledby, also see wpt/accname/name/comp_text_node.html -->
107
+
<h1aria-labeledby="n2" data-expectedlabel="second label" data-testname="h1 text is superceded by aria-labeledby (non-standard spelling)" class="ex">x</h1>
108
+
109
+
<!-- Step 2H: Recursive Name from Content, see wpt/accname/name/comp_name_from_content.html -->
110
+
<h3data-expectedlabel="image link2 link3" data-testname="heading name from content for each child including two nested links using aria-labeledby (non-standard spelling) with nested image" class="ex">
111
+
<ahref="#" aria-labeledby="nested_image_label2">
112
+
link1<!-- this text is skipped because of aria-labeledby -->
113
+
</a>
114
+
<ahref="#" data-expectedlabel="link2 image link3" data-testname="link name from content for each child including nested image (referenced elsewhere via labeledby)" class="ex">
<!-- image skipped in this link (when computing heading text) because it was already referenced by the first link within this heading label recursion cycle. -->
118
+
<!-- but image not skipped when computing the text of the link itself since it has not been referenced in that context -->
119
+
link3
120
+
</a>
121
+
</h3>
122
+
123
+
<!-- Step 2I: Tooltip is superceded by 2B: AriaLabeledby, also see wpt/accname/name/comp_tooltip.html -->
124
+
<buttonaria-labeledby="n2" title="foo" data-expectedlabel="second label" data-testname="button with title is superceded by aria-labeledby (non-standard spelling)" class="ex">x</button>
125
+
126
+
39
127
<!--
40
128
41
129
BLOCKED on https://github.com/w3c/accname/issues/209
0 commit comments