|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <title>Test usemap elements and ARIA</title> |
|
5 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
6 |
|
7 <script type="application/javascript" |
|
8 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <script type="application/javascript" |
|
10 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
|
11 |
|
12 <script type="application/javascript" |
|
13 src="../common.js"></script> |
|
14 <script type="application/javascript" |
|
15 src="../role.js"></script> |
|
16 <script type="application/javascript" |
|
17 src="../events.js"></script> |
|
18 <script type="application/javascript" |
|
19 src="../states.js"></script> |
|
20 |
|
21 <script type="application/javascript"> |
|
22 //gA11yEventDumpToConsole = true; |
|
23 function doPreTest() |
|
24 { |
|
25 waitForImageMap("imagemap", doTest); |
|
26 } |
|
27 |
|
28 function doTest() |
|
29 { |
|
30 var accTree = { |
|
31 role: ROLE_IMAGE_MAP, |
|
32 children: [ |
|
33 { |
|
34 role: ROLE_ENTRY, |
|
35 name: "first name" |
|
36 }, |
|
37 { |
|
38 role: ROLE_ENTRY, |
|
39 name: "last name" |
|
40 }, |
|
41 { |
|
42 role: ROLE_RADIOBUTTON, |
|
43 name: "male" |
|
44 }, |
|
45 { |
|
46 role: ROLE_RADIOBUTTON, |
|
47 name: "female" |
|
48 }, |
|
49 { |
|
50 role: ROLE_CHECKBUTTON, |
|
51 name: "have bike" |
|
52 }, |
|
53 { |
|
54 role: ROLE_COMBOBOX, |
|
55 name: "bike model" |
|
56 }, |
|
57 { |
|
58 role: ROLE_CHECKBUTTON, |
|
59 name: "have car" |
|
60 }, |
|
61 { |
|
62 role: ROLE_CHECKBUTTON, |
|
63 name: "have airplane" |
|
64 }, |
|
65 { |
|
66 role: ROLE_PUSHBUTTON, |
|
67 name: "submit" |
|
68 } |
|
69 ] |
|
70 }; |
|
71 |
|
72 // Test image map tree structure, roles, and names. |
|
73 testAccessibleTree("imagemap", accTree); |
|
74 |
|
75 SimpleTest.finish(); |
|
76 } |
|
77 |
|
78 SimpleTest.waitForExplicitFinish(); |
|
79 addA11yLoadEvent(doPreTest); |
|
80 </script> |
|
81 |
|
82 </head> |
|
83 <body> |
|
84 |
|
85 <a target="_blank" |
|
86 href="https://bugzilla.mozilla.org/show_bug.cgi?id=548291" |
|
87 title="Accessible tree of ARIA image maps"> |
|
88 Mozilla Bug 548291 |
|
89 </a> |
|
90 <p id="display"></p> |
|
91 <div id="content" style="display: none"></div> |
|
92 <pre id="test"> |
|
93 </pre> |
|
94 |
|
95 <img id="imagemap" src="../formimage.png" width="219" height="229" border="0" usemap="#ariaMap"> |
|
96 <map id="ariaMap" name="ariaMap"> |
|
97 <area id="t1" role="textbox" shape="rect" tabindex="0" alt="" title="first name" coords="4,20,108,48" href="#" /> |
|
98 <area id="t2" role="textbox" shape="rect" alt="" title="last name" coords="111,21,215,50" href="#" /> |
|
99 <area id="rb1" role="radio" aria-checked="true" shape="circle" alt="" title="male" coords="60,75,11" href="#" /> |
|
100 <area id="rb2" role="radio" shape="circle" alt="" title="female" coords="73,94,11" href="#" /> |
|
101 <area id="cb1" role="checkbox" aria-checked="true" shape="rect" alt="" title="have bike" coords="95,123,118,145" href="#" /> |
|
102 <area id="cbox" role="combobox" shape="rect" alt="" title="bike model" coords="120,124,184,146" href="#" /> |
|
103 <area id="cb2" role="checkbox" shape="rect" alt="" title="have car" coords="90,145,114,164" href="#" /> |
|
104 <area id="cb3" role="checkbox" shape="rect" alt="" title="have airplane" coords="130,163,152,184" href="#" /> |
|
105 <area id="b1" role="button" shape="rect" alt="" title="submit" coords="4,198,67,224" href="#" /> |
|
106 </map> |
|
107 </body> |
|
108 </html> |