Update device orientation & motion permission native SPI as per latest proposal
[WebKit-https.git] / LayoutTests / accessibility / fieldset-element.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 <script src="../resources/accessibility-helper.js"></script>
6 <title>Fieldset Element</title>
7 </head>
8 <body>
9 <div id="content">
10 <form>
11 <!-- fieldset with aria-label. -->
12 <fieldset aria-label="High Score:" class="fieldsetTest" id="f0">
13 Name: <input type="text">
14 </fieldset>
15 </form>
16
17 <form>
18 <!-- fieldset and legend. -->
19 <fieldset class="fieldsetTest" id="f1">
20 <legend>High Score:</legend>
21 Name: <input type="text">
22 </fieldset>
23 </form>
24
25 <form>
26 <!-- fieldset with aria-label and legend. -->
27 <fieldset aria-label="New High Score:" class="fieldsetTest" id="f2">
28 <legend>High Score:</legend>
29 Name: <input type="text">
30 </fieldset>
31 </form>
32
33 <form>
34 <!-- fieldset and legend with aria-label. -->
35 <fieldset class="fieldsetTest" id="f3">
36 <legend aria-label="New High Score:">High Score:</legend>
37 Name: <input type="text">
38 </fieldset>
39 </form>
40
41 <form>
42 <!-- fieldset and hidden legend. -->
43 <fieldset class="fieldsetTest" id="f4">
44 <legend aria-hidden="true">High Score:</legend>
45 Name: <input type="text">
46 </fieldset>
47 </form>
48
49 <form>
50 <!-- fieldset and offscreen legend. -->
51 <fieldset class="fieldsetTest" id="f5">
52 <legend style="left:-9999px; position:absolute;">High Score:</legend>
53 Name: <input type="text">
54 </fieldset>
55 </form>
56
57 <form>
58 <!-- fieldset and unrendered legend. -->
59 <fieldset class="fieldsetTest" id="f6">
60 <legend style="display:none;">High Score:</legend>
61 Name: <input type="text">
62 </fieldset>
63 </form>
64
65 <!-- legend outside fieldset. -->
66 <legend id="l0">Other:</legend>
67 </div>
68 <p id="description"></p>
69 <div id="console"></div>
70
71 <script>
72     description("This tests that fieldset and legend elements are exposed correctly.");
73     
74     if (window.accessibilityController) {
75         var fieldsetDescription = 0;
76         var fieldsetTestCount = 0;
77         var legendValue = 0;
78         
79         // fieldset tests.
80         fieldsetTestCount = document.getElementsByClassName("fieldsetTest").length;
81         for (var i = 0; i < fieldsetTestCount; ++i) {
82             var accName = platformValueForW3CName(accessibilityController.accessibleElementById("f" + i));
83             debug("element id 'f" + i + "': " +  accName);
84         }
85
86         // legend tests.
87         var legend = accessibilityController.accessibleElementById("l0");
88         if (legend.childrenCount)
89             legend = legend.childAtIndex(0);
90         debug("element id 'l0': " + legend.stringValue);
91
92         document.getElementById("content").style.visibility = "hidden";
93     }
94 </script>
95
96 <script src="../resources/js-test-post.js"></script>
97 </body>
98 </html>