accessible/tests/mochitest/tree/test_formctrl.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 <!DOCTYPE html>
michael@0 2 <html>
michael@0 3
michael@0 4 <head>
michael@0 5 <title>HTML form controls tests</title>
michael@0 6 <link rel="stylesheet" type="text/css"
michael@0 7 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
michael@0 8
michael@0 9 <script type="application/javascript"
michael@0 10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 11
michael@0 12 <script type="application/javascript"
michael@0 13 src="../common.js"></script>
michael@0 14 <script type="application/javascript"
michael@0 15 src="../role.js"></script>
michael@0 16
michael@0 17 <script type="application/javascript">
michael@0 18 function doTest()
michael@0 19 {
michael@0 20 // input@type="checkbox"
michael@0 21 var accTree = {
michael@0 22 role: ROLE_CHECKBUTTON,
michael@0 23 children: [ ]
michael@0 24 };
michael@0 25
michael@0 26 testAccessibleTree("checkbox", accTree);
michael@0 27
michael@0 28 // input@type="radio"
michael@0 29 accTree = {
michael@0 30 role: ROLE_RADIOBUTTON,
michael@0 31 children: [ ]
michael@0 32 };
michael@0 33
michael@0 34 testAccessibleTree("radio", accTree);
michael@0 35
michael@0 36 // input@type="button" and input@type="submit"
michael@0 37 // button
michael@0 38 accTree = {
michael@0 39 role: ROLE_PUSHBUTTON,
michael@0 40 children: [
michael@0 41 {
michael@0 42 role: ROLE_TEXT_LEAF // XXX Bug 567203
michael@0 43 }
michael@0 44 ]
michael@0 45 };
michael@0 46
michael@0 47 testAccessibleTree("btn1", accTree);
michael@0 48 testAccessibleTree("submit", accTree);
michael@0 49 testAccessibleTree("btn2", accTree);
michael@0 50
michael@0 51 // input@type="image"
michael@0 52 accTree = {
michael@0 53 role: ROLE_PUSHBUTTON,
michael@0 54 children: [
michael@0 55 {
michael@0 56 role: ROLE_STATICTEXT
michael@0 57 }
michael@0 58 ]
michael@0 59 };
michael@0 60 testAccessibleTree("image_submit", accTree);
michael@0 61
michael@0 62 // input@type="range"
michael@0 63 accTree = { SLIDER: [ ] };
michael@0 64 testAccessibleTree("range", accTree);
michael@0 65
michael@0 66 // input@type="number"
michael@0 67 accTree =
michael@0 68 { SPINBUTTON: [
michael@0 69 { ENTRY: [ ] },
michael@0 70 { PUSHBUTTON: [ ] },
michael@0 71 { PUSHBUTTON: [ ] }
michael@0 72 ] };
michael@0 73 testAccessibleTree("number", accTree);
michael@0 74
michael@0 75 // output
michael@0 76 accTree = {
michael@0 77 role: ROLE_SECTION,
michael@0 78 children: [
michael@0 79 {
michael@0 80 role: ROLE_TEXT_LEAF
michael@0 81 }
michael@0 82 ]
michael@0 83 };
michael@0 84 testAccessibleTree("output", accTree);
michael@0 85
michael@0 86 SimpleTest.finish();
michael@0 87 }
michael@0 88
michael@0 89 SimpleTest.waitForExplicitFinish();
michael@0 90 addA11yLoadEvent(doTest);
michael@0 91 </script>
michael@0 92 </head>
michael@0 93 <body>
michael@0 94
michael@0 95 <a target="_blank"
michael@0 96 title="Fix O(n^2) access to all the children of a container"
michael@0 97 href="https://bugzilla.mozilla.org/show_bug.cgi?id=342045">
michael@0 98 Bug 342045
michael@0 99 </a>
michael@0 100 <a target="_blank"
michael@0 101 title="add test for role of input type='image'"
michael@0 102 href="https://bugzilla.mozilla.org/show_bug.cgi?id=524521">
michael@0 103 Bug 524521
michael@0 104 </a>
michael@0 105 <a target="_blank"
michael@0 106 href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036"
michael@0 107 title="make HTML <output> accessible">
michael@0 108 Bug 558036
michael@0 109 </a>
michael@0 110 <a target="_blank"
michael@0 111 href="https://bugzilla.mozilla.org/show_bug.cgi?id=559764"
michael@0 112 title="make HTML5 input@type=range element accessible">
michael@0 113 Bug 559764
michael@0 114 </a>
michael@0 115 <p id="display"></p>
michael@0 116 <div id="content" style="display: none"></div>
michael@0 117 <pre id="test">
michael@0 118 </pre>
michael@0 119
michael@0 120 <input type="checkbox" id="checkbox">
michael@0 121 <input type="radio" id="radio">
michael@0 122 <input type="button" value="button" id="btn1">
michael@0 123 <button id="btn2">button</button>
michael@0 124
michael@0 125 <input type="submit" id="submit">
michael@0 126 <input type="image" id="image_submit">
michael@0 127 <input type="range" id="range">
michael@0 128 <input type="number" id="number">
michael@0 129 <output id="output">1337</output>
michael@0 130
michael@0 131 </body>
michael@0 132 </html>

mercurial