OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> |
| 4 |
| 5 <map name="imagemap1"> |
| 6 <area shape="rect" coords="10,20,100,30" href="#" title="Link1" /> |
| 7 <area shape="rect" coords="30,40,100,50" href="#" title="Link2" /> |
| 8 </map> |
| 9 |
| 10 <img src="resources/cake.png" usemap="#imagemap1" style="position: absolute; lef
t: 200px; top: 100px;"> |
| 11 |
| 12 <script> |
| 13 function findAllImageMapLinks(node, list) { |
| 14 if (node.role == "AXRole: AXLink") |
| 15 list.push(node); |
| 16 for (var i = 0; i < node.childrenCount; i++) |
| 17 findAllImageMapLinks(node.childAtIndex(i), list); |
| 18 } |
| 19 |
| 20 test(function(t) { |
| 21 var links = []; |
| 22 findAllImageMapLinks(accessibilityController.rootElement, links); |
| 23 |
| 24 assert_equals(links.length, 2); |
| 25 assert_equals(links[0].name, "Link1"); |
| 26 assert_equals(links[0].x, 210); |
| 27 assert_equals(links[0].y, 120); |
| 28 assert_equals(links[1].name, "Link2"); |
| 29 assert_equals(links[1].x, 230); |
| 30 assert_equals(links[1].y, 140); |
| 31 }, "Test bounds of image map links"); |
| 32 </script> |
| 33 |
| 34 </body> |
| 35 </html> |
OLD | NEW |