4 <script src=
"../resources/js-test-pre.js"></script>
5 <script src=
"../resources/accessibility-helper.js"></script>
6 <title>Self-Referencing aria-labelledby
</title>
10 <!-- Self-referencing label should be the content text. -->
11 <a aria-labelledby=
"t0 s0 s1" class=
"test" href=
"#" id=
"t0">X
</a>
13 <!-- Self-referencing label should be the aria-label text. -->
14 <a aria-label=
"X" aria-labelledby=
"t1 s0 s1" class=
"test" href=
"#" id=
"t1">?
</a>
16 <!-- Self-referencing label should be the title text. -->
17 <img alt=
"" aria-labelledby=
"t2 s0 s1" class=
"test" id=
"t2" src=
"resources/cake.png" title=
"X">
19 <!-- Self-referencing label should be the alt text. -->
20 <img alt=
"X" aria-labelledby=
"t3 s0 s1" class=
"test" id=
"t3" src=
"resources/cake.png" title=
"?">
22 <!-- Self-referencing label should be the aria-label text. -->
23 <img alt=
"?" aria-label=
"X" aria-labelledby=
"t4 s0 s1" class=
"test" id=
"t4" src=
"resources/cake.png" title=
"?">
25 <!-- Self-referencing label should be the value text. -->
26 <input aria-labelledby=
"t5 s0 s1" class=
"test" id=
"t5" type=
"text" value=
"X">
28 <!-- Self-referencing label should be the aria-label text. -->
29 <input aria-label=
"X" aria-labelledby=
"t6 s0 s1" class=
"test" id=
"t6" type=
"button" value=
"?">
31 <span id=
"s0">Y
</span>
32 <span id=
"s1">Z
</span>
34 <p id=
"description"></p>
35 <div id=
"console"></div>
38 description("This tests that self-referencing aria-labelledby is exposed correctly.");
40 if (window
.accessibilityController
) {
41 testCount
= document
.getElementsByClassName("test").length
;
42 for (var i
= 0; i
< testCount
; ++i
) {
43 var test
= accessibilityController
.accessibleElementById("t" + i
);
44 shouldBeEqualToString("platformValueForW3CName(test)", "X Y Z");
47 document
.getElementById("content").style
.visibility
= "hidden";
51 <script src=
"../resources/js-test-post.js"></script>