1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/tree/test_aria_globals.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,129 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 +<head> 1.7 + <title>Test Global ARIA States and Accessible Creation</title> 1.8 + <link rel="stylesheet" type="text/css" 1.9 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.10 + 1.11 + <script type="application/javascript" 1.12 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.13 + 1.14 + <script type="application/javascript" 1.15 + src="../common.js"></script> 1.16 + <script type="application/javascript" 1.17 + src="../role.js"></script> 1.18 + 1.19 + <script type="application/javascript"> 1.20 + function doTest() 1.21 + { 1.22 + var globalIds = [ 1.23 + "atomic", 1.24 + "busy", 1.25 + "controls", 1.26 + "describedby", 1.27 + "disabled", 1.28 + "dropeffect", 1.29 + "flowto", 1.30 + "grabbed", 1.31 + "haspopup", 1.32 + "hidden", 1.33 + "invalid", 1.34 + "label", 1.35 + "labelledby", 1.36 + "live", 1.37 + "owns", 1.38 + "relevant" 1.39 + ]; 1.40 + 1.41 + // Elements having ARIA global state or properties or referred by another 1.42 + // element must be accessible. 1.43 + ok(isAccessible("pawn"), 1.44 + "Must be accessible because referred by another element."); 1.45 + 1.46 + for (var idx = 0; idx < globalIds.length; idx++) { 1.47 + ok(isAccessible(globalIds[idx]), 1.48 + "Must be accessible becuase of " + "aria-" + globalIds[idx] + 1.49 + " presence"); 1.50 + } 1.51 + 1.52 + // Unfocusable elements, having ARIA global state or property with a valid 1.53 + // IDREF value, and an inherited presentation role. A generic accessible 1.54 + // is created (to prevent table cells text jamming). 1.55 + ok(!isAccessible("td_nothing", nsIAccessibleTableCell), 1.56 + "inherited presentation role takes a place"); 1.57 + 1.58 + for (var idx = 0; idx < globalIds.length; idx++) { 1.59 + ok(isAccessible("td_" + globalIds[idx]), 1.60 + "Inherited presentation role must be ignored becuase of " + 1.61 + "aria-" + globalIds[idx] + " presence"); 1.62 + } 1.63 + 1.64 + SimpleTest.finish(); 1.65 + } 1.66 + 1.67 + SimpleTest.waitForExplicitFinish(); 1.68 + addA11yLoadEvent(doTest); 1.69 + </script> 1.70 +</head> 1.71 +<body> 1.72 + 1.73 + <a target="_blank" 1.74 + title="Update universal ARIA attribute support to latest spec" 1.75 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=551978"> 1.76 + Mozilla Bug 551978 1.77 + </a> 1.78 + <a target="_blank" 1.79 + title="Presentational table related elements referred or having global ARIA attributes must be accessible" 1.80 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=809751"> 1.81 + Mozilla Bug 809751 1.82 + </a> 1.83 + <p id="display"></p> 1.84 + <div id="content" style="display: none"></div> 1.85 + <pre id="test"> 1.86 + </pre> 1.87 + 1.88 + <!-- Test that global aria states and properties are enough to cause the 1.89 + creation of accessible objects --> 1.90 + <div id="global_aria_states_and_props" role="group"> 1.91 + <span id="pawn"></span> 1.92 + <span id="atomic" aria-atomic="true"></span> 1.93 + <span id="busy" aria-busy="false"></span> 1.94 + <span id="controls" aria-controls="pawn"></span> 1.95 + <span id="describedby" aria-describedby="pawn"></span> 1.96 + <span id="disabled" aria-disabled="true"></span> 1.97 + <span id="dropeffect" aria-dropeffect="move"></span> 1.98 + <span id="flowto" aria-flowto="pawn"></span> 1.99 + <span id="grabbed" aria-grabbed="false"></span> 1.100 + <span id="haspopup" aria-haspopup="false"></span> 1.101 + <span id="hidden" aria-hidden="true"></span> 1.102 + <span id="invalid" aria-invalid="false"></span> 1.103 + <span id="label" aria-label="hi"></span> 1.104 + <span id="labelledby" aria-labelledby="label"></span> 1.105 + <span id="live" aria-live="polite"></span> 1.106 + <span id="owns" aria-owns="pawn"></span> 1.107 + <span id="relevant" aria-relevant="additions"></span> 1.108 + </div> 1.109 + 1.110 + <table role="presentation"> 1.111 + <tr> 1.112 + <td id="td_nothing"></td> 1.113 + <td id="td_atomic" aria-atomic="true"></td> 1.114 + <td id="td_busy" aria-busy="false"></td> 1.115 + <td id="td_controls" aria-controls="pawn"></td> 1.116 + <td id="td_describedby" aria-describedby="pawn"></td> 1.117 + <td id="td_disabled" aria-disabled="true"></td> 1.118 + <td id="td_dropeffect" aria-dropeffect="move"></td> 1.119 + <td id="td_flowto" aria-flowto="pawn"></td> 1.120 + <td id="td_grabbed" aria-grabbed="false"></td> 1.121 + <td id="td_haspopup" aria-haspopup="false"></td> 1.122 + <td id="td_hidden" aria-hidden="true"></td> 1.123 + <td id="td_invalid" aria-invalid="false"></td> 1.124 + <td id="td_label" aria-label="hi"></td> 1.125 + <td id="td_labelledby" aria-labelledby="label"></td> 1.126 + <td id="td_live" aria-live="polite"></td> 1.127 + <td id="td_owns" aria-owns="pawn"></td> 1.128 + <td id="td_relevant" aria-relevant="additions"></td> 1.129 + </tr> 1.130 + </table> 1.131 +</body> 1.132 +</html>