Backed out changeset db55605b2a4c (relanding bug 121341)
[wine-gecko.git] / accessible / tests / mochitest / test_cssattrs.html
blobb9eb6011fb6d2f7bad5b3d2aca2826d22de63bbe
1 <html>
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=439566
4 -->
5 <head>
6 <title>CSS-like attributes tests</title>
7 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
9 <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
10 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
12 <script type="application/javascript">
13 const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
15 var gAccRetrieval = null;
17 function testAttr(aID, aName, aValue)
19 var acc = null;
20 try {
21 acc = gAccRetrieval.getAccessibleFor(document.getElementById(aID));
22 } catch(e) { }
24 if (!acc) {
25 ok(false, "Can't get accessible object for " + aID);
26 return;
29 var attrs = null;
30 try {
31 attrs = acc.attributes;
32 } catch(e) { }
34 if (!attrs) {
35 ok(false, "Can't get accessible attributes for " + aID);
36 return;
39 is(attrs.getStringProperty(aName), aValue,
40 "Accessible with ID " + aID + " has wrong attribute value");
43 function doTest()
45 gAccRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
46 getService(nsIAccessibleRetrieval);
48 testAttr("span", "display", "inline");
49 testAttr("div", "display", "block");
50 testAttr("p", "display", "block");
51 testAttr("input", "display", "inline");
52 testAttr("table", "display", "table");
53 testAttr("tr", "display", "table-row");
54 testAttr("td", "display", "table-cell");
56 SimpleTest.finish();
59 SimpleTest.waitForExplicitFinish();
60 addLoadEvent(doTest);
61 </script>
62 </head>
63 <body>
65 <a target="_blank"
66 href="https://bugzilla.mozilla.org/show_bug.cgi?id=439566"
67 title="Include the css display property as an IAccessible2 object attribute">
68 Mozilla Bug 439566
69 </a>
70 <p id="display"></p>
71 <div id="content" style="display: none"></div>
72 <pre id="test">
73 </pre>
75 <span id="span" role="group">It's span</span>
76 <div id="div">It's div</div>
77 <p id="p">It's paragraph"</p>
78 <input id="input"/>
79 <table id="table">
80 <tr id="tr" role="group">
81 <td id="td">td</td>
82 </tr>
83 </table>
84 </body>
85 </html>