Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / aria-current.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 </head>
6 <body id="body">
7
8 <nav role="navigation">
9     <!-- All of these eval to 'false' -->
10     <ul><li><a class="ex" data-expected="false" href="/">Nav1</a></li></ul>
11     <ul><li><a class="ex" data-expected="false" href="/" aria-current="false">Nav2</a></li></ul>
12     <ul><li><a class="ex" data-expected="false" href="/" aria-current="">Nav3</a></li></ul>
13     <ul><li><a class="ex" data-expected="false" href="/" aria-current=" ">Nav4</a></li></ul>
14     <ul><li><a class="ex" data-expected="false" href="/" aria-current=" ">Nav5</a></li></ul> <!-- tab char -->
15     <ul><li><a class="ex" data-expected="false" href="/" aria-current="
16     ">Nav6</a></li></ul> <!-- newline char -->
17
18     <!-- Known token values in ARIA 1.1 -->
19     <ul><li><a class="ex" data-expected="page" href="/" aria-current="page">Nav7</a></li></ul>
20     <ul><li><a class="ex" data-expected="step" href="/" aria-current="step">Nav8</a></li></ul>
21     <ul><li><a class="ex" data-expected="location" href="/" aria-current="location">Nav9</a></li></ul>
22     <ul><li><a class="ex" data-expected="date" href="/" aria-current="date">Nav10</a></li></ul>
23     <ul><li><a class="ex" data-expected="time" href="/" aria-current="time">Nav11</a></li></ul>
24     <ul><li><a class="ex" data-expected="true" href="/" aria-current="true">Nav12</a></li></ul>
25
26     <!-- All other string values -->
27     <ul><li><a class="ex" data-expected="true" href="/" aria-current="sometext">Nav13</a></li></ul>
28     <ul><li><a class="ex" data-expected="true" href="/" aria-current="page step">Nav14</a></li></ul>
29     <ul><li><a class="ex" data-expected="page" href="/" aria-current="page ">Nav15</a></li></ul>
30     <ul><li><a class="ex" data-expected="step" href="/" aria-current="  step ">Nav16</a></li></ul>
31 </nav>
32
33 <p id="description"></p>
34 <div id="console"></div>
35
36 <script>
37
38     description("This tests that aria-current causes the right attribute to be returned.");
39
40     function verify(value, expectation, element) {
41       if (value === expectation)
42         debug("PASS: AXARIACurrent is " + value);
43       else
44         debug("FAIL: AXARIACurrent is " + value + ". Expected: " + expectation + ". " + (element ? element.outerHTML : ""));
45     }
46
47     if (window.accessibilityController) {
48         var examples = document.querySelectorAll(".ex");
49         for (var i = 0, c = examples.length; i < c; i++) {
50             var el = examples[i];
51             el.focus();
52             var expectation = el.getAttribute("data-expected");
53             var value = accessibilityController.focusedElement.stringAttributeValue('AXARIACurrent');
54             verify(value, expectation, el);
55         }
56     }
57
58 </script>
59
60 <script src="../resources/js-test-post.js"></script>
61 </body>
62 </html>