|
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 imageMap = getAccessible("imagemap"); |
|
31 |
|
32 var t1 = imageMap.getChildAt(0); |
|
33 testStates(t1, 0, EXT_STATE_EDITABLE, STATE_LINKED); |
|
34 var t2 = imageMap.getChildAt(1); |
|
35 testStates(t2, 0, EXT_STATE_EDITABLE, STATE_LINKED); |
|
36 var rb1 = imageMap.getChildAt(2); |
|
37 testStates(rb1, (STATE_CHECKABLE | STATE_CHECKED), 0, STATE_LINKED); |
|
38 var rb2 = imageMap.getChildAt(3); |
|
39 testStates(rb2, STATE_CHECKABLE, 0, STATE_CHECKED, STATE_LINKED); |
|
40 var cb1 = imageMap.getChildAt(4); |
|
41 testStates(cb1, (STATE_CHECKABLE | STATE_CHECKED), 0, STATE_LINKED); |
|
42 var cbox = imageMap.getChildAt(5); |
|
43 testStates(cbox, (STATE_HASPOPUP | STATE_COLLAPSED), |
|
44 EXT_STATE_EXPANDABLE, STATE_LINKED); |
|
45 |
|
46 SimpleTest.finish(); |
|
47 } |
|
48 |
|
49 SimpleTest.waitForExplicitFinish(); |
|
50 addA11yLoadEvent(doPreTest); |
|
51 </script> |
|
52 |
|
53 </head> |
|
54 <body> |
|
55 |
|
56 <a target="_blank" |
|
57 href="https://bugzilla.mozilla.org/show_bug.cgi?id=548291" |
|
58 title="ARIA states on image maps"> |
|
59 Mozilla Bug 548291 |
|
60 </a> |
|
61 <p id="display"></p> |
|
62 <div id="content" style="display: none"></div> |
|
63 <pre id="test"> |
|
64 </pre> |
|
65 |
|
66 <img id="imagemap" src="../formimage.png" width="219" height="229" border="0" usemap="#ariaMap"> |
|
67 <map id="ariaMap" name="ariaMap"> |
|
68 <area id="t1" role="textbox" shape="rect" tabindex="0" alt="" title="first name" coords="4,20,108,48" href="#" /> |
|
69 <area id="t2" role="textbox" shape="rect" alt="" title="last name" coords="111,21,215,50" href="#" /> |
|
70 <area id="rb1" role="radio" aria-checked="true" shape="circle" alt="" title="male" coords="60,75,11" href="#" /> |
|
71 <area id="rb2" role="radio" shape="circle" alt="" title="female" coords="73,94,11" href="#" /> |
|
72 <area id="cb1" role="checkbox" aria-checked="true" shape="rect" alt="" title="have bike" coords="95,123,118,145" href="#" /> |
|
73 <area id="cbox" role="combobox" shape="rect" alt="" title="bike model" coords="120,124,184,146" href="#" /> |
|
74 <area id="cb2" role="checkbox" shape="rect" alt="" title="have car" coords="90,145,114,164" href="#" /> |
|
75 <area id="cb3" role="checkbox" shape="rect" alt="" title="have airplane" coords="130,163,152,184" href="#" /> |
|
76 <area id="b1" role="button" shape="rect" alt="" title="submit" coords="4,198,67,224" href="#" /> |
|
77 </map> |
|
78 </body> |
|
79 </html> |