1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/test_descr.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,87 @@ 1.4 +<html> 1.5 + 1.6 +<head> 1.7 + <title>nsIAccessible::description tests</title> 1.8 + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.9 + 1.10 + <script type="application/javascript" 1.11 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <script type="application/javascript" 1.13 + src="common.js"></script> 1.14 + <script type="application/javascript" 1.15 + src="name.js"></script> 1.16 + 1.17 + <script type="application/javascript"> 1.18 + function doTest() 1.19 + { 1.20 + // Description from aria-describedby attribute 1.21 + testDescr("img1", "aria description"); 1.22 + 1.23 + // No description from @title attribute because it is used to generate 1.24 + // name. 1.25 + testDescr("img2", ""); 1.26 + 1.27 + // Description from @title attribute, name is generated from @alt 1.28 + // attribute. 1.29 + testDescr("img3", "description"); 1.30 + 1.31 + // Description from content of h2. 1.32 + testDescr("p", "heading"); 1.33 + 1.34 + // From table summary (caption is used as a name) 1.35 + testDescr("table1", "summary"); 1.36 + 1.37 + // Empty (summary is used as a name) 1.38 + testDescr("table2", ""); 1.39 + 1.40 + // From title (summary is used as a name) 1.41 + testDescr("table3", "title"); 1.42 + 1.43 + SimpleTest.finish(); 1.44 + } 1.45 + 1.46 + SimpleTest.waitForExplicitFinish(); 1.47 + addA11yLoadEvent(doTest); 1.48 + </script> 1.49 + 1.50 +</head> 1.51 + 1.52 +<body> 1.53 + 1.54 + <a target="_blank" 1.55 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=489944" 1.56 + title="@title attribute no longer exposed on accDescription"> 1.57 + Mozilla Bug 489944 1.58 + </a> 1.59 + <a target="_blank" 1.60 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=666212" 1.61 + title="summary attribute content mapped to accessible name in MSAA"> 1.62 + Mozilla Bug 666212 1.63 + </a> 1.64 + <p id="display"></p> 1.65 + <div id="content" style="display: none"></div> 1.66 + <pre id="test"> 1.67 + </pre> 1.68 + 1.69 + <p id="description">aria description</p> 1.70 + <img id="img1" aria-describedby="description" /> 1.71 + <img id="img2" title="title" /> 1.72 + <img id="img3" alt="name" title="description" /> 1.73 + 1.74 + <h2 id="heading">heading</h2> 1.75 + <p id="p" aria-describedby="heading" role="button">click me</p> 1.76 + 1.77 + <table id="table1" summary="summary"> 1.78 + <caption>caption</caption> 1.79 + <tr><td>cell</td></tr> 1.80 + </table> 1.81 + 1.82 + <table id="table2" summary="summary"> 1.83 + <tr><td>cell</td></tr> 1.84 + </table> 1.85 + 1.86 + <table id="table3" summary="summary" title="title"> 1.87 + <tr><td>cell</td></tr> 1.88 + </table> 1.89 +</body> 1.90 +</html>