|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <title>HTML5 figure/figcaption tests</title> |
|
5 <link rel="stylesheet" type="text/css" |
|
6 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
7 |
|
8 <script type="application/javascript" |
|
9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
10 |
|
11 <script type="application/javascript" |
|
12 src="../common.js"></script> |
|
13 <script type="application/javascript" |
|
14 src="../role.js"></script> |
|
15 <script type="application/javascript" |
|
16 src="../attributes.js"></script> |
|
17 <script type="application/javascript" |
|
18 src="../relations.js"></script> |
|
19 <script type="application/javascript" |
|
20 src="../name.js"></script> |
|
21 |
|
22 <script type="application/javascript"> |
|
23 |
|
24 function doTest() |
|
25 { |
|
26 testRole("figure", ROLE_FIGURE); |
|
27 testRole("figcaption", ROLE_CAPTION); |
|
28 |
|
29 todo(false, "figure name gets extra whitespace in the end!"); |
|
30 testName("figure", "figure caption "); |
|
31 testName("figcaption", null); |
|
32 |
|
33 testRelation("figure", RELATION_LABELLED_BY, "figcaption"); |
|
34 testRelation("figcaption", RELATION_LABEL_FOR, "figure"); |
|
35 |
|
36 testAttrs("figure", {"xml-roles" : "figure"}, true); |
|
37 |
|
38 SimpleTest.finish(); |
|
39 } |
|
40 |
|
41 SimpleTest.waitForExplicitFinish(); |
|
42 addA11yLoadEvent(doTest); |
|
43 </script> |
|
44 </head> |
|
45 <body> |
|
46 |
|
47 <a target="_blank" |
|
48 title="Implement figure and figcaption accessibility" |
|
49 href="https://bugzilla.mozilla.org/show_bug.cgi?id=658272"> |
|
50 Mozilla Bug 658272 |
|
51 </a><br/> |
|
52 <p id="display"></p> |
|
53 <div id="content" style="display: none"></div> |
|
54 <pre id="test"> |
|
55 </pre> |
|
56 |
|
57 <figure id="figure"> |
|
58 <figcaption id="figcaption">figure caption</figcaption> |
|
59 </figure> |
|
60 |
|
61 </body> |
|
62 </html> |