|
1 <html> |
|
2 |
|
3 <head> |
|
4 <title>nsIAccessible::description tests</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="common.js"></script> |
|
11 <script type="application/javascript" |
|
12 src="name.js"></script> |
|
13 |
|
14 <script type="application/javascript"> |
|
15 function doTest() |
|
16 { |
|
17 // Description from aria-describedby attribute |
|
18 testDescr("img1", "aria description"); |
|
19 |
|
20 // No description from @title attribute because it is used to generate |
|
21 // name. |
|
22 testDescr("img2", ""); |
|
23 |
|
24 // Description from @title attribute, name is generated from @alt |
|
25 // attribute. |
|
26 testDescr("img3", "description"); |
|
27 |
|
28 // Description from content of h2. |
|
29 testDescr("p", "heading"); |
|
30 |
|
31 // From table summary (caption is used as a name) |
|
32 testDescr("table1", "summary"); |
|
33 |
|
34 // Empty (summary is used as a name) |
|
35 testDescr("table2", ""); |
|
36 |
|
37 // From title (summary is used as a name) |
|
38 testDescr("table3", "title"); |
|
39 |
|
40 SimpleTest.finish(); |
|
41 } |
|
42 |
|
43 SimpleTest.waitForExplicitFinish(); |
|
44 addA11yLoadEvent(doTest); |
|
45 </script> |
|
46 |
|
47 </head> |
|
48 |
|
49 <body> |
|
50 |
|
51 <a target="_blank" |
|
52 href="https://bugzilla.mozilla.org/show_bug.cgi?id=489944" |
|
53 title="@title attribute no longer exposed on accDescription"> |
|
54 Mozilla Bug 489944 |
|
55 </a> |
|
56 <a target="_blank" |
|
57 href="https://bugzilla.mozilla.org/show_bug.cgi?id=666212" |
|
58 title="summary attribute content mapped to accessible name in MSAA"> |
|
59 Mozilla Bug 666212 |
|
60 </a> |
|
61 <p id="display"></p> |
|
62 <div id="content" style="display: none"></div> |
|
63 <pre id="test"> |
|
64 </pre> |
|
65 |
|
66 <p id="description">aria description</p> |
|
67 <img id="img1" aria-describedby="description" /> |
|
68 <img id="img2" title="title" /> |
|
69 <img id="img3" alt="name" title="description" /> |
|
70 |
|
71 <h2 id="heading">heading</h2> |
|
72 <p id="p" aria-describedby="heading" role="button">click me</p> |
|
73 |
|
74 <table id="table1" summary="summary"> |
|
75 <caption>caption</caption> |
|
76 <tr><td>cell</td></tr> |
|
77 </table> |
|
78 |
|
79 <table id="table2" summary="summary"> |
|
80 <tr><td>cell</td></tr> |
|
81 </table> |
|
82 |
|
83 <table id="table3" summary="summary" title="title"> |
|
84 <tr><td>cell</td></tr> |
|
85 </table> |
|
86 </body> |
|
87 </html> |