accessible/tests/mochitest/test_descr.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

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

mercurial