accessible/tests/mochitest/tree/test_txtcntr.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 text containers 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 var accTree = {
michael@0 21 role: ROLE_SECTION,
michael@0 22 children: [
michael@0 23 { // text child
michael@0 24 role: ROLE_TEXT_LEAF,
michael@0 25 children: []
michael@0 26 }
michael@0 27 ]
michael@0 28 };
michael@0 29
michael@0 30 testAccessibleTree("c1", accTree);
michael@0 31 testAccessibleTree("c2", accTree);
michael@0 32
michael@0 33 accTree = {
michael@0 34 role: ROLE_SECTION,
michael@0 35 children: [
michael@0 36 {
michael@0 37 role: ROLE_TEXT_LEAF,
michael@0 38 name: "Hello1"
michael@0 39 },
michael@0 40 {
michael@0 41 role: ROLE_WHITESPACE
michael@0 42 },
michael@0 43 {
michael@0 44 role: ROLE_TEXT_LEAF,
michael@0 45 name: "Hello2"
michael@0 46 },
michael@0 47 {
michael@0 48 role: ROLE_SEPARATOR
michael@0 49 },
michael@0 50 {
michael@0 51 role: ROLE_TEXT_LEAF,
michael@0 52 name: "Hello3 "
michael@0 53 },
michael@0 54 {
michael@0 55 role: ROLE_PARAGRAPH,
michael@0 56 children: [
michael@0 57 {
michael@0 58 role: ROLE_TEXT_LEAF,
michael@0 59 name: "Hello4 "
michael@0 60 }
michael@0 61 ]
michael@0 62 }
michael@0 63 ]
michael@0 64 };
michael@0 65
michael@0 66 testAccessibleTree("c3", accTree);
michael@0 67
michael@0 68 // contentEditable div
michael@0 69 accTree = {
michael@0 70 role: ROLE_SECTION,
michael@0 71 children: [
michael@0 72 {
michael@0 73 role: ROLE_TEXT_LEAF,
michael@0 74 name: "helllo "
michael@0 75 },
michael@0 76 {
michael@0 77 role: ROLE_PARAGRAPH,
michael@0 78 children: [
michael@0 79 {
michael@0 80 role: ROLE_TEXT_LEAF,
michael@0 81 name: "blabla"
michael@0 82 }
michael@0 83 ]
michael@0 84 },
michael@0 85 {
michael@0 86 role: ROLE_TEXT_LEAF,
michael@0 87 name: "hello "
michael@0 88 }
michael@0 89 ]
michael@0 90 };
michael@0 91
michael@0 92 testAccessibleTree("c4", accTree);
michael@0 93
michael@0 94 // blockquote
michael@0 95 accTree = {
michael@0 96 role: ROLE_SECTION,
michael@0 97 children: [
michael@0 98 { // block quote
michael@0 99 role: ROLE_SECTION,
michael@0 100 children: [
michael@0 101 { // text child
michael@0 102 role: ROLE_TEXT_LEAF,
michael@0 103 name: "Hello",
michael@0 104 children: []
michael@0 105 }
michael@0 106 ]
michael@0 107 }
michael@0 108 ]
michael@0 109 };
michael@0 110
michael@0 111 testAccessibleTree("c5", accTree);
michael@0 112
michael@0 113 // abbreviation tag
michael@0 114 accTree = {
michael@0 115 role: ROLE_SECTION,
michael@0 116 children: [
michael@0 117 { // text leaf
michael@0 118 role: ROLE_TEXT_LEAF,
michael@0 119 name: "This ",
michael@0 120 children: []
michael@0 121 },
michael@0 122 { // abbr tag
michael@0 123 role: ROLE_TEXT_CONTAINER,
michael@0 124 name: "accessibility",
michael@0 125 children: [
michael@0 126 { // text leaf with actual text
michael@0 127 role: ROLE_TEXT_LEAF,
michael@0 128 name: "a11y",
michael@0 129 children: []
michael@0 130 }
michael@0 131 ]
michael@0 132 },
michael@0 133 { // text leaf
michael@0 134 role: ROLE_TEXT_LEAF,
michael@0 135 name: " test",
michael@0 136 children: []
michael@0 137 }
michael@0 138 ]
michael@0 139 };
michael@0 140
michael@0 141 testAccessibleTree("c6", accTree);
michael@0 142
michael@0 143 // acronym tag
michael@0 144 accTree = {
michael@0 145 role: ROLE_SECTION,
michael@0 146 children: [
michael@0 147 { // text leaf
michael@0 148 role: ROLE_TEXT_LEAF,
michael@0 149 name: "This ",
michael@0 150 children: []
michael@0 151 },
michael@0 152 { // acronym tag
michael@0 153 role: ROLE_TEXT_CONTAINER,
michael@0 154 name: "personal computer",
michael@0 155 children: [
michael@0 156 { // text leaf with actual text
michael@0 157 role: ROLE_TEXT_LEAF,
michael@0 158 name: "PC",
michael@0 159 children: []
michael@0 160 }
michael@0 161 ]
michael@0 162 },
michael@0 163 { // text leaf
michael@0 164 role: ROLE_TEXT_LEAF,
michael@0 165 name: " is broken",
michael@0 166 children: []
michael@0 167 }
michael@0 168 ]
michael@0 169 };
michael@0 170
michael@0 171 testAccessibleTree("c7", accTree);
michael@0 172
michael@0 173 // only whitespace between images should be exposed
michael@0 174 accTree = {
michael@0 175 SECTION: [
michael@0 176 { GRAPHIC: [] },
michael@0 177 { TEXT_LEAF: [] },
michael@0 178 { GRAPHIC: [] }
michael@0 179 ]
michael@0 180 };
michael@0 181 testAccessibleTree("c8", accTree);
michael@0 182
michael@0 183 SimpleTest.finish();
michael@0 184 }
michael@0 185
michael@0 186 SimpleTest.waitForExplicitFinish();
michael@0 187 addA11yLoadEvent(doTest);
michael@0 188 </script>
michael@0 189 </head>
michael@0 190 <body>
michael@0 191
michael@0 192 <a target="_blank"
michael@0 193 title="overflowed content doesn't expose child text accessibles"
michael@0 194 href="https://bugzilla.mozilla.org/show_bug.cgi?id=489306">
michael@0 195 Mozilla Bug 489306</a>
michael@0 196 <a target="_blank"
michael@0 197 title="Create child accessibles for text controls from native anonymous content"
michael@0 198 href="https://bugzilla.mozilla.org/show_bug.cgi?id=542824">
michael@0 199 Mozilla Bug 542824</a>
michael@0 200 <a target="_blank"
michael@0 201 title="Update accessible tree on content insertion after layout"
michael@0 202 href="https://bugzilla.mozilla.org/show_bug.cgi?id=498015">
michael@0 203 Mozilla Bug 498015</a>
michael@0 204
michael@0 205 <p id="display"></p>
michael@0 206 <div id="content" style="display: none"></div>
michael@0 207 <pre id="test">
michael@0 208 </pre>
michael@0 209
michael@0 210 <div id="c1" style="width: 100px; height: 100px; overflow: auto;">
michael@0 211 1hellohello 2hellohello 3hellohello 4hellohello 5hellohello 6hellohello 7hellohello
michael@0 212 </div>
michael@0 213 <div id="c2">
michael@0 214 1hellohello 2hellohello 3hellohello 4hellohello 5hellohello 6hellohello 7hellohello
michael@0 215 </div>
michael@0 216 <div id="c3">
michael@0 217 Hello1<br>
michael@0 218 Hello2<hr>
michael@0 219 Hello3
michael@0 220 <p>
michael@0 221 Hello4
michael@0 222 </p>
michael@0 223 </div>
michael@0 224 <div id="c4" contentEditable="true">
michael@0 225 helllo <p>blabla</p> hello
michael@0 226 </div>
michael@0 227 <div id="c5"><blockquote>Hello</blockquote></div>
michael@0 228 <div id="c6">This <abbr title="accessibility">a11y</abbr> test</div>
michael@0 229 <div id="c7">This <acronym title="personal computer">PC</acronym> is broken</div>
michael@0 230
michael@0 231 <!-- only whitespace between images should be exposed -->
michael@0 232 <div id="c8"> <img src="../moz.png"> <img src="../moz.png"> </div>
michael@0 233 </body>
michael@0 234 </html>

mercurial