Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / aria-namefrom-author.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 <script src="../resources/accessibility-helper.js"></script>
6 </head>
7 <body id="body">
8
9 <div id="content">
10
11 <div id="test1" class="test" role="alert">alert</div>
12 <div id="test2" class="test" role="alertdialog">alertdialog</div>
13 <div id="test3" class="test" role="dialog">dialog</div>
14 <div id="test4" class="test" role="log">log</div>
15 <div id="test5" class="test" role="marquee">marquee</div>
16 <div id="test6" class="test" role="status">status</div>
17 <div id="test7" class="test" role="timer">timer</div>
18 <div id="test8" class="test" role="combobox">combobox</div>
19 <div id="test9" class="test" role="definition">definition</div>
20 <div id="test10" class="test" role="document">document</div>
21 <div id="test11" class="test" role="article">article</div>
22 <div id="test12" class="test" role="math">math</div>
23 <div id="test13" class="test" role="note">note</div>
24 <div id="test14" class="test" role="table">table</div>
25 <div id="test15" class="test" role="form">form</div>
26 <div id="test16" class="test" role="grid">grid</div>
27 <div id="test17" class="test" role="group">group</div>
28 <div id="test18" class="test" role="img">img</div>
29 <div id="test19" class="test" role="list">list</div>
30 <div id="test20" class="test" role="listbox">listbox</div>
31 <div id="test21" class="test" role="application">application</div>
32 <div id="test22" class="test" role="banner">banner</div>
33 <div id="test23" class="test" role="complementary">complementary</div>
34 <div id="test24" class="test" role="contentinfo">contentinfo</div>
35 <div id="test25" class="test" role="navigation">navigation</div>
36 <div id="test26" class="test" role="main">main</div>
37 <div id="test27" class="test" role="search">search</div>
38 <div id="test28" class="test" role="menu">menu</div>
39 <div id="test29" class="test" role="menubar">menubar</div>
40 <div id="test30" class="test" role="progressbar">progressbar</div>
41 <div id="test31" class="test" role="radiogroup">radiogroup</div>
42 <div id="test32" class="test" role="scrollbar">scrollbar</div>
43 <div id="test33" class="test" role="slider">slider</div>
44 <div id="test34" class="test" role="spinbutton">spinbutton</div>
45 <div id="test35" class="test" role="separator">separator</div>
46 <div id="test36" class="test" role="tablist">tablist</div>
47 <div id="test37" class="test" role="tabpanel">tabpanel</div>
48 <div id="test38" class="test" role="textbox">textbox</div>
49 <div id="test39" class="test" role="toolbar">toolbar</div>
50 <div id="test40" class="test" role="treegrid">treegrid</div>
51 <div id="test41" class="test" role="tree">tree</div>
52
53
54 <div role="button" id="button" aria-label="text">button text</div>
55 </div>
56
57 <p id="description"></p>
58 <div id="console"></div>
59
60 <script>
61
62     description("This tests all the cases where nameFrom: author is used instead of nameFrom: contents. This means that if these elements are used in aria-labelledby they should not return their inner text. The button should retain its aria-label.");
63
64     var labelledby = "";
65     for (var k = 1; k < 42; k++) {
66         labelledby += "test" + k + " ";
67     }
68     document.getElementById("button").setAttribute("aria-labelledby", labelledby);
69
70     if (window.accessibilityController) {
71         var buttonAccName = platformValueForW3CName(accessibilityController.accessibleElementById("button"));
72         var button = document.getElementById("button");
73         shouldBeTrue("buttonAccName == button.getAttribute('aria-label')");
74         shouldBeTrue("buttonAccName != button.innerText");
75
76         document.getElementById("content").style.visibility = "hidden";
77     }
78
79 </script>
80
81 <script src="../resources/js-test-post.js"></script>
82 </body>
83 </html>