1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/tree/test_txtcntr.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,234 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 + 1.7 +<head> 1.8 + <title>HTML text containers tests</title> 1.9 + <link rel="stylesheet" type="text/css" 1.10 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.11 + 1.12 + <script type="application/javascript" 1.13 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.14 + 1.15 + <script type="application/javascript" 1.16 + src="../common.js"></script> 1.17 + <script type="application/javascript" 1.18 + src="../role.js"></script> 1.19 + 1.20 + <script type="application/javascript"> 1.21 + function doTest() 1.22 + { 1.23 + var accTree = { 1.24 + role: ROLE_SECTION, 1.25 + children: [ 1.26 + { // text child 1.27 + role: ROLE_TEXT_LEAF, 1.28 + children: [] 1.29 + } 1.30 + ] 1.31 + }; 1.32 + 1.33 + testAccessibleTree("c1", accTree); 1.34 + testAccessibleTree("c2", accTree); 1.35 + 1.36 + accTree = { 1.37 + role: ROLE_SECTION, 1.38 + children: [ 1.39 + { 1.40 + role: ROLE_TEXT_LEAF, 1.41 + name: "Hello1" 1.42 + }, 1.43 + { 1.44 + role: ROLE_WHITESPACE 1.45 + }, 1.46 + { 1.47 + role: ROLE_TEXT_LEAF, 1.48 + name: "Hello2" 1.49 + }, 1.50 + { 1.51 + role: ROLE_SEPARATOR 1.52 + }, 1.53 + { 1.54 + role: ROLE_TEXT_LEAF, 1.55 + name: "Hello3 " 1.56 + }, 1.57 + { 1.58 + role: ROLE_PARAGRAPH, 1.59 + children: [ 1.60 + { 1.61 + role: ROLE_TEXT_LEAF, 1.62 + name: "Hello4 " 1.63 + } 1.64 + ] 1.65 + } 1.66 + ] 1.67 + }; 1.68 + 1.69 + testAccessibleTree("c3", accTree); 1.70 + 1.71 + // contentEditable div 1.72 + accTree = { 1.73 + role: ROLE_SECTION, 1.74 + children: [ 1.75 + { 1.76 + role: ROLE_TEXT_LEAF, 1.77 + name: "helllo " 1.78 + }, 1.79 + { 1.80 + role: ROLE_PARAGRAPH, 1.81 + children: [ 1.82 + { 1.83 + role: ROLE_TEXT_LEAF, 1.84 + name: "blabla" 1.85 + } 1.86 + ] 1.87 + }, 1.88 + { 1.89 + role: ROLE_TEXT_LEAF, 1.90 + name: "hello " 1.91 + } 1.92 + ] 1.93 + }; 1.94 + 1.95 + testAccessibleTree("c4", accTree); 1.96 + 1.97 + // blockquote 1.98 + accTree = { 1.99 + role: ROLE_SECTION, 1.100 + children: [ 1.101 + { // block quote 1.102 + role: ROLE_SECTION, 1.103 + children: [ 1.104 + { // text child 1.105 + role: ROLE_TEXT_LEAF, 1.106 + name: "Hello", 1.107 + children: [] 1.108 + } 1.109 + ] 1.110 + } 1.111 + ] 1.112 + }; 1.113 + 1.114 + testAccessibleTree("c5", accTree); 1.115 + 1.116 + // abbreviation tag 1.117 + accTree = { 1.118 + role: ROLE_SECTION, 1.119 + children: [ 1.120 + { // text leaf 1.121 + role: ROLE_TEXT_LEAF, 1.122 + name: "This ", 1.123 + children: [] 1.124 + }, 1.125 + { // abbr tag 1.126 + role: ROLE_TEXT_CONTAINER, 1.127 + name: "accessibility", 1.128 + children: [ 1.129 + { // text leaf with actual text 1.130 + role: ROLE_TEXT_LEAF, 1.131 + name: "a11y", 1.132 + children: [] 1.133 + } 1.134 + ] 1.135 + }, 1.136 + { // text leaf 1.137 + role: ROLE_TEXT_LEAF, 1.138 + name: " test", 1.139 + children: [] 1.140 + } 1.141 + ] 1.142 + }; 1.143 + 1.144 + testAccessibleTree("c6", accTree); 1.145 + 1.146 + // acronym tag 1.147 + accTree = { 1.148 + role: ROLE_SECTION, 1.149 + children: [ 1.150 + { // text leaf 1.151 + role: ROLE_TEXT_LEAF, 1.152 + name: "This ", 1.153 + children: [] 1.154 + }, 1.155 + { // acronym tag 1.156 + role: ROLE_TEXT_CONTAINER, 1.157 + name: "personal computer", 1.158 + children: [ 1.159 + { // text leaf with actual text 1.160 + role: ROLE_TEXT_LEAF, 1.161 + name: "PC", 1.162 + children: [] 1.163 + } 1.164 + ] 1.165 + }, 1.166 + { // text leaf 1.167 + role: ROLE_TEXT_LEAF, 1.168 + name: " is broken", 1.169 + children: [] 1.170 + } 1.171 + ] 1.172 + }; 1.173 + 1.174 + testAccessibleTree("c7", accTree); 1.175 + 1.176 + // only whitespace between images should be exposed 1.177 + accTree = { 1.178 + SECTION: [ 1.179 + { GRAPHIC: [] }, 1.180 + { TEXT_LEAF: [] }, 1.181 + { GRAPHIC: [] } 1.182 + ] 1.183 + }; 1.184 + testAccessibleTree("c8", accTree); 1.185 + 1.186 + SimpleTest.finish(); 1.187 + } 1.188 + 1.189 + SimpleTest.waitForExplicitFinish(); 1.190 + addA11yLoadEvent(doTest); 1.191 + </script> 1.192 +</head> 1.193 +<body> 1.194 + 1.195 + <a target="_blank" 1.196 + title="overflowed content doesn't expose child text accessibles" 1.197 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=489306"> 1.198 + Mozilla Bug 489306</a> 1.199 + <a target="_blank" 1.200 + title="Create child accessibles for text controls from native anonymous content" 1.201 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=542824"> 1.202 + Mozilla Bug 542824</a> 1.203 + <a target="_blank" 1.204 + title="Update accessible tree on content insertion after layout" 1.205 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=498015"> 1.206 + Mozilla Bug 498015</a> 1.207 + 1.208 + <p id="display"></p> 1.209 + <div id="content" style="display: none"></div> 1.210 + <pre id="test"> 1.211 + </pre> 1.212 + 1.213 + <div id="c1" style="width: 100px; height: 100px; overflow: auto;"> 1.214 + 1hellohello 2hellohello 3hellohello 4hellohello 5hellohello 6hellohello 7hellohello 1.215 + </div> 1.216 + <div id="c2"> 1.217 + 1hellohello 2hellohello 3hellohello 4hellohello 5hellohello 6hellohello 7hellohello 1.218 + </div> 1.219 + <div id="c3"> 1.220 + Hello1<br> 1.221 + Hello2<hr> 1.222 + Hello3 1.223 + <p> 1.224 + Hello4 1.225 + </p> 1.226 + </div> 1.227 + <div id="c4" contentEditable="true"> 1.228 + helllo <p>blabla</p> hello 1.229 + </div> 1.230 + <div id="c5"><blockquote>Hello</blockquote></div> 1.231 + <div id="c6">This <abbr title="accessibility">a11y</abbr> test</div> 1.232 + <div id="c7">This <acronym title="personal computer">PC</acronym> is broken</div> 1.233 + 1.234 + <!-- only whitespace between images should be exposed --> 1.235 + <div id="c8"> <img src="../moz.png"> <img src="../moz.png"> </div> 1.236 +</body> 1.237 +</html>