2011-05-24 Jay Civelli <jcivelli@chromium.org>
[WebKit-https.git] / LayoutTests / accessibility / image-map-title-causes-crash.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">\r
2 <html>\r
3 <head>\r
4 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css">\r
5 <script>\r
6     var successfullyParsed = false;\r
7 \r
8     function removeAreaElement() {\r
9         document.getElementById("test").innerHTML=1\r
10     }\r
11 \r
12     function queryTitleOnDecendants(accessibilityObject) {\r
13         accessibilityObject.title\r
14 \r
15         var count = accessibilityObject.childrenCount;\r
16         for (var i = 0; i < count; ++i)\r
17             queryTitleOnDecendants(accessibilityObject.childAtIndex(i));\r
18     }\r
19 </script>\r
20 <script src="../fast/js/resources/js-test-pre.js"></script>\r
21 </head>\r
22 <body>\r
23 \r
24 <img usemap="#map">\r
25 <map name="map" id="test"><area href="javascript:document.getElementById('result').innerHTML='area clicked'" /></map>\r
26 \r
27 <p id="description"></p>\r
28 <div id="console"></div>\r
29 \r
30 <script>\r
31     description("Requesting the title of an AccessibilityImageMapLink can cause a crash when the map's area element has been removed.");\r
32 \r
33     if (window.accessibilityController) {\r
34         // First build up full accessibility tree.\r
35         document.body.focus();\r
36         queryTitleOnDecendants(accessibilityController.focusedElement);\r
37         \r
38         removeAreaElement()\r
39         \r
40         // Now call request the title for each accessibility object.\r
41         document.body.focus();\r
42         queryTitleOnDecendants(accessibilityController.focusedElement);\r
43     }\r
44 \r
45     successfullyParsed = true;\r
46 </script>\r
47 \r
48 <script src="../fast/js/resources/js-test-post.js"></script>\r
49 </body>\r
50 </html>\r