jdiggs@igalia.com | 51d2ebf | 2014-11-22 18:18:11 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <script> |
| 4 | function dumpAccessibilityChildren(element, level) { |
| 5 | if (element.stringValue.indexOf('End of test') >= 0) |
| 6 | return false; |
| 7 | |
| 8 | var indent = ""; |
| 9 | for (var k = 0; k < level; k++) { indent += " "; } |
| 10 | debug(indent + element.role + " " + element.title + " " + element.description); |
| 11 | var childrenCount = element.childrenCount; |
| 12 | for (var k = 0; k < childrenCount; k++) { |
| 13 | if (!dumpAccessibilityChildren(element.childAtIndex(k), level+1)) |
| 14 | return false; |
| 15 | } |
| 16 | return true; |
| 17 | } |
| 18 | </script> |
| 19 | <script src="../resources/js-test-pre.js"></script> |
| 20 | </head> |
| 21 | <body id="body"> |
| 22 | <img src="myimg.png" width="100" height="100" usemap="#mymap" alt="foo bar baz" /> |
| 23 | <map name="mymap"> |
| 24 | <area shape="rect" coords="0, 0, 33, 100" alt="foo" href="#"> |
| 25 | <area shape="rect" coords="33, 0, 66, 100" alt="bar" href="#"> |
| 26 | <area shape="rect" coords="66, 0, 100, 100" alt="baz" href="#"> |
| 27 | </map> |
| 28 | <div>End of test</div> |
| 29 | <p id="description"></p> |
| 30 | <div id="console"></div> |
| 31 | <script> |
| 32 | description("This tests the hierarchy of an image with alt text and a map."); |
| 33 | if (window.accessibilityController) { |
| 34 | document.getElementById("body").focus(); |
| 35 | dumpAccessibilityChildren(accessibilityController.focusedElement, 0); |
| 36 | } |
| 37 | </script> |
| 38 | <script src="../resources/js-test-post.js"></script> |
| 39 | </body> |
| 40 | </html> |