Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | <html> |
michael@0 | 2 | |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>nsIAccessible::name calculation for HTML links (html:a)</title> |
michael@0 | 5 | |
michael@0 | 6 | <link rel="stylesheet" |
michael@0 | 7 | type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 8 | |
michael@0 | 9 | <script type="application/javascript" |
michael@0 | 10 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 11 | |
michael@0 | 12 | <script type="application/javascript" |
michael@0 | 13 | src="../common.js"></script> |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="../name.js"></script> |
michael@0 | 16 | |
michael@0 | 17 | <script type="application/javascript"> |
michael@0 | 18 | function doTest() |
michael@0 | 19 | { |
michael@0 | 20 | // aria-label |
michael@0 | 21 | testName("aria_label", "anchor label"); |
michael@0 | 22 | |
michael@0 | 23 | // aria-labelledby |
michael@0 | 24 | testName("aria_labelledby", "text"); |
michael@0 | 25 | |
michael@0 | 26 | // html:label |
michael@0 | 27 | testName("label", "label"); |
michael@0 | 28 | |
michael@0 | 29 | // name from content |
michael@0 | 30 | testName("namefromcontent", "1"); |
michael@0 | 31 | |
michael@0 | 32 | // name from content |
michael@0 | 33 | testName("namefromimg", "img title"); |
michael@0 | 34 | |
michael@0 | 35 | // no name from content |
michael@0 | 36 | testName("nonamefromcontent", null); |
michael@0 | 37 | |
michael@0 | 38 | // title |
michael@0 | 39 | testName("title", "title"); |
michael@0 | 40 | |
michael@0 | 41 | SimpleTest.finish(); |
michael@0 | 42 | } |
michael@0 | 43 | |
michael@0 | 44 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 45 | addA11yLoadEvent(doTest); |
michael@0 | 46 | </script> |
michael@0 | 47 | |
michael@0 | 48 | </head> |
michael@0 | 49 | |
michael@0 | 50 | <body> |
michael@0 | 51 | |
michael@0 | 52 | <a target="_blank" |
michael@0 | 53 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=459782" |
michael@0 | 54 | title="nsIAccessible::name calculation for HTML links (html:a)"> |
michael@0 | 55 | Mozilla Bug 459782 |
michael@0 | 56 | </a> |
michael@0 | 57 | <p id="display"></p> |
michael@0 | 58 | <div id="content" style="display: none"></div> |
michael@0 | 59 | <pre id="test"> |
michael@0 | 60 | </pre> |
michael@0 | 61 | |
michael@0 | 62 | <!-- aria-label --> |
michael@0 | 63 | <a id="aria_label" href="mozilla.org" |
michael@0 | 64 | aria-label="anchor label">1</a> |
michael@0 | 65 | <br/> |
michael@0 | 66 | |
michael@0 | 67 | <!-- aria-labelledby, preferred to html:label --> |
michael@0 | 68 | <span id="text">text</span> |
michael@0 | 69 | <label for="aria_labelledby">label</label> |
michael@0 | 70 | <a id="aria_labelledby" href="mozilla.org" |
michael@0 | 71 | aria-labelledby="text">1</a> |
michael@0 | 72 | <br/> |
michael@0 | 73 | |
michael@0 | 74 | <!-- label, preferred to name from content --> |
michael@0 | 75 | <label for="label">label</label> |
michael@0 | 76 | <a id="label" href="mozilla.org">1</a> |
michael@0 | 77 | <br/> |
michael@0 | 78 | |
michael@0 | 79 | <!-- name from content, preferred to @title --> |
michael@0 | 80 | <a id="namefromcontent" href="mozilla.org" |
michael@0 | 81 | title="title">1</a> |
michael@0 | 82 | <br/> |
michael@0 | 83 | |
michael@0 | 84 | <!-- name from content, preferred to @title --> |
michael@0 | 85 | <a id="namefromimg" href="mozilla.org" |
michael@0 | 86 | title="title"><img alt="img title" /></a> |
michael@0 | 87 | |
michael@0 | 88 | <!-- no name from content, ARIA role overrides this rule --> |
michael@0 | 89 | <a id="nonamefromcontent" href="mozilla.org" role="img">1</a> |
michael@0 | 90 | <br/> |
michael@0 | 91 | |
michael@0 | 92 | <!-- no content, name from @title --> |
michael@0 | 93 | <a id="title" href="mozilla.org" |
michael@0 | 94 | title="title"></a> |
michael@0 | 95 | |
michael@0 | 96 | </body> |
michael@0 | 97 | </html> |