Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Test Global ARIA States and Accessible Creation</title> |
michael@0 | 5 | <link rel="stylesheet" type="text/css" |
michael@0 | 6 | href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 7 | |
michael@0 | 8 | <script type="application/javascript" |
michael@0 | 9 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | |
michael@0 | 11 | <script type="application/javascript" |
michael@0 | 12 | src="../common.js"></script> |
michael@0 | 13 | <script type="application/javascript" |
michael@0 | 14 | src="../role.js"></script> |
michael@0 | 15 | |
michael@0 | 16 | <script type="application/javascript"> |
michael@0 | 17 | function doTest() |
michael@0 | 18 | { |
michael@0 | 19 | var globalIds = [ |
michael@0 | 20 | "atomic", |
michael@0 | 21 | "busy", |
michael@0 | 22 | "controls", |
michael@0 | 23 | "describedby", |
michael@0 | 24 | "disabled", |
michael@0 | 25 | "dropeffect", |
michael@0 | 26 | "flowto", |
michael@0 | 27 | "grabbed", |
michael@0 | 28 | "haspopup", |
michael@0 | 29 | "hidden", |
michael@0 | 30 | "invalid", |
michael@0 | 31 | "label", |
michael@0 | 32 | "labelledby", |
michael@0 | 33 | "live", |
michael@0 | 34 | "owns", |
michael@0 | 35 | "relevant" |
michael@0 | 36 | ]; |
michael@0 | 37 | |
michael@0 | 38 | // Elements having ARIA global state or properties or referred by another |
michael@0 | 39 | // element must be accessible. |
michael@0 | 40 | ok(isAccessible("pawn"), |
michael@0 | 41 | "Must be accessible because referred by another element."); |
michael@0 | 42 | |
michael@0 | 43 | for (var idx = 0; idx < globalIds.length; idx++) { |
michael@0 | 44 | ok(isAccessible(globalIds[idx]), |
michael@0 | 45 | "Must be accessible becuase of " + "aria-" + globalIds[idx] + |
michael@0 | 46 | " presence"); |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | // Unfocusable elements, having ARIA global state or property with a valid |
michael@0 | 50 | // IDREF value, and an inherited presentation role. A generic accessible |
michael@0 | 51 | // is created (to prevent table cells text jamming). |
michael@0 | 52 | ok(!isAccessible("td_nothing", nsIAccessibleTableCell), |
michael@0 | 53 | "inherited presentation role takes a place"); |
michael@0 | 54 | |
michael@0 | 55 | for (var idx = 0; idx < globalIds.length; idx++) { |
michael@0 | 56 | ok(isAccessible("td_" + globalIds[idx]), |
michael@0 | 57 | "Inherited presentation role must be ignored becuase of " + |
michael@0 | 58 | "aria-" + globalIds[idx] + " presence"); |
michael@0 | 59 | } |
michael@0 | 60 | |
michael@0 | 61 | SimpleTest.finish(); |
michael@0 | 62 | } |
michael@0 | 63 | |
michael@0 | 64 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 65 | addA11yLoadEvent(doTest); |
michael@0 | 66 | </script> |
michael@0 | 67 | </head> |
michael@0 | 68 | <body> |
michael@0 | 69 | |
michael@0 | 70 | <a target="_blank" |
michael@0 | 71 | title="Update universal ARIA attribute support to latest spec" |
michael@0 | 72 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=551978"> |
michael@0 | 73 | Mozilla Bug 551978 |
michael@0 | 74 | </a> |
michael@0 | 75 | <a target="_blank" |
michael@0 | 76 | title="Presentational table related elements referred or having global ARIA attributes must be accessible" |
michael@0 | 77 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=809751"> |
michael@0 | 78 | Mozilla Bug 809751 |
michael@0 | 79 | </a> |
michael@0 | 80 | <p id="display"></p> |
michael@0 | 81 | <div id="content" style="display: none"></div> |
michael@0 | 82 | <pre id="test"> |
michael@0 | 83 | </pre> |
michael@0 | 84 | |
michael@0 | 85 | <!-- Test that global aria states and properties are enough to cause the |
michael@0 | 86 | creation of accessible objects --> |
michael@0 | 87 | <div id="global_aria_states_and_props" role="group"> |
michael@0 | 88 | <span id="pawn"></span> |
michael@0 | 89 | <span id="atomic" aria-atomic="true"></span> |
michael@0 | 90 | <span id="busy" aria-busy="false"></span> |
michael@0 | 91 | <span id="controls" aria-controls="pawn"></span> |
michael@0 | 92 | <span id="describedby" aria-describedby="pawn"></span> |
michael@0 | 93 | <span id="disabled" aria-disabled="true"></span> |
michael@0 | 94 | <span id="dropeffect" aria-dropeffect="move"></span> |
michael@0 | 95 | <span id="flowto" aria-flowto="pawn"></span> |
michael@0 | 96 | <span id="grabbed" aria-grabbed="false"></span> |
michael@0 | 97 | <span id="haspopup" aria-haspopup="false"></span> |
michael@0 | 98 | <span id="hidden" aria-hidden="true"></span> |
michael@0 | 99 | <span id="invalid" aria-invalid="false"></span> |
michael@0 | 100 | <span id="label" aria-label="hi"></span> |
michael@0 | 101 | <span id="labelledby" aria-labelledby="label"></span> |
michael@0 | 102 | <span id="live" aria-live="polite"></span> |
michael@0 | 103 | <span id="owns" aria-owns="pawn"></span> |
michael@0 | 104 | <span id="relevant" aria-relevant="additions"></span> |
michael@0 | 105 | </div> |
michael@0 | 106 | |
michael@0 | 107 | <table role="presentation"> |
michael@0 | 108 | <tr> |
michael@0 | 109 | <td id="td_nothing"></td> |
michael@0 | 110 | <td id="td_atomic" aria-atomic="true"></td> |
michael@0 | 111 | <td id="td_busy" aria-busy="false"></td> |
michael@0 | 112 | <td id="td_controls" aria-controls="pawn"></td> |
michael@0 | 113 | <td id="td_describedby" aria-describedby="pawn"></td> |
michael@0 | 114 | <td id="td_disabled" aria-disabled="true"></td> |
michael@0 | 115 | <td id="td_dropeffect" aria-dropeffect="move"></td> |
michael@0 | 116 | <td id="td_flowto" aria-flowto="pawn"></td> |
michael@0 | 117 | <td id="td_grabbed" aria-grabbed="false"></td> |
michael@0 | 118 | <td id="td_haspopup" aria-haspopup="false"></td> |
michael@0 | 119 | <td id="td_hidden" aria-hidden="true"></td> |
michael@0 | 120 | <td id="td_invalid" aria-invalid="false"></td> |
michael@0 | 121 | <td id="td_label" aria-label="hi"></td> |
michael@0 | 122 | <td id="td_labelledby" aria-labelledby="label"></td> |
michael@0 | 123 | <td id="td_live" aria-live="polite"></td> |
michael@0 | 124 | <td id="td_owns" aria-owns="pawn"></td> |
michael@0 | 125 | <td id="td_relevant" aria-relevant="additions"></td> |
michael@0 | 126 | </tr> |
michael@0 | 127 | </table> |
michael@0 | 128 | </body> |
michael@0 | 129 | </html> |