accessible/tests/mochitest/attributes/test_obj.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/attributes/test_obj.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,261 @@
     1.4 +<html>
     1.5 +<!--
     1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=475006
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=391829
     1.8 +https://bugzilla.mozilla.org/show_bug.cgi?id=581952
     1.9 +https://bugzilla.mozilla.org/show_bug.cgi?id=558036
    1.10 +-->
    1.11 +<head>
    1.12 +  <title>Group attributes tests</title>
    1.13 +  <link rel="stylesheet" type="text/css"
    1.14 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.15 +
    1.16 +  <script type="application/javascript"
    1.17 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.18 +
    1.19 +  <script type="application/javascript"
    1.20 +          src="../common.js"></script>
    1.21 +  <script type="application/javascript"
    1.22 +          src="../attributes.js"></script>
    1.23 +
    1.24 +  <script type="application/javascript">
    1.25 +    function doTest()
    1.26 +    {
    1.27 +      // aria
    1.28 +      testAttrs("atomic", {"atomic" : "true", "container-atomic" : "true"}, true);
    1.29 +      testAttrs(getNode("atomic").firstChild, {"container-atomic" : "true"}, true);
    1.30 +      testAbsentAttrs("atomic_false", {"atomic" : "false", "container-atomic" : "false"});
    1.31 +      testAbsentAttrs(getNode("atomic_false").firstChild, {"container-atomic" : "false"});
    1.32 +
    1.33 +      testAttrs("autocomplete", {"autocomplete" : "true"}, true);
    1.34 +      testAttrs("checkbox", {"checkable" : "true"}, true); 
    1.35 +      testAttrs("checkedCheckbox", {"checkable" : "true"}, true); 
    1.36 +      testAttrs("checkedMenuitem", {"checkable" : "true"}, true); 
    1.37 +      testAttrs("checkedOption", {"checkable" : "true"}, true); 
    1.38 +      testAttrs("checkedRadio", {"checkable" : "true"}, true); 
    1.39 +      testAttrs("checkedTreeitem", {"checkable" : "true"}, true); 
    1.40 +      testAttrs("dropeffect", {"dropeffect" : "copy"}, true);
    1.41 +      testAttrs("grabbed", {"grabbed" : "true"}, true);
    1.42 +      testAttrs("hidden", {"hidden" : "true"}, true);
    1.43 +      testAbsentAttrs("hidden_false", { "hidden": "false" });
    1.44 +      testAttrs("sortAscending", {"sort" : "ascending"}, true);
    1.45 +      testAttrs("sortDescending", {"sort" : "descending"}, true);
    1.46 +      testAttrs("sortNone", {"sort" : "none"}, true);
    1.47 +      testAttrs("sortOther", {"sort" : "other"}, true);
    1.48 +
    1.49 +      // inherited attributes by subdocuments
    1.50 +      var subdoc = getAccessible("iframe").firstChild;
    1.51 +      testAttrs(subdoc, {"busy" : "true"}, true);
    1.52 +
    1.53 +      // live object attribute
    1.54 +
    1.55 +      // HTML
    1.56 +      testAttrs("output", {"live" : "polite"}, true);
    1.57 +
    1.58 +      // ARIA
    1.59 +      testAttrs("live", {"live" : "polite"}, true);
    1.60 +      testAttrs("live2", {"live" : "polite"}, true);
    1.61 +      testAbsentAttrs("live3", {"live" : ""});
    1.62 +      testAttrs("log", {"live" : "polite"}, true);
    1.63 +      testAttrs("logAssertive", {"live" : "assertive"}, true);
    1.64 +      testAttrs("marquee", {"live" : "off"}, true);
    1.65 +      testAttrs("status", {"live" : "polite"}, true);
    1.66 +      testAttrs("timer", {"live" : "off"}, true);
    1.67 +      testAbsentAttrs("tablist", {"live" : "polite"});
    1.68 +
    1.69 +      // container-live object attribute
    1.70 +      testAttrs("liveChild", {"container-live" : "polite"}, true);
    1.71 +      testAttrs("live2Child", {"container-live" : "polite"}, true);
    1.72 +      testAttrs("logChild", {"container-live" : "polite"}, true);
    1.73 +      testAttrs("logAssertiveChild", {"container-live" : "assertive"}, true);
    1.74 +      testAttrs("marqueeChild", {"container-live" : "off"}, true);
    1.75 +      testAttrs("statusChild", {"container-live" : "polite"}, true);
    1.76 +      testAttrs("timerChild", {"container-live" : "off"}, true);
    1.77 +      testAbsentAttrs("tablistChild", {"container-live" : "polite"});
    1.78 +
    1.79 +      // container-live-role object attribute
    1.80 +      testAttrs("log", {"container-live-role" : "log"}, true);
    1.81 +      testAttrs("logAssertive", {"container-live-role" : "log"}, true);
    1.82 +      testAttrs("marquee", {"container-live-role" : "marquee"}, true);
    1.83 +      testAttrs("status", {"container-live-role" : "status"}, true);
    1.84 +      testAttrs("timer", {"container-live-role" : "timer"}, true);
    1.85 +      testAttrs("logChild", {"container-live-role" : "log"}, true);
    1.86 +      testAttrs("logAssertive", {"container-live-role" : "log"}, true);
    1.87 +      testAttrs("logAssertiveChild", {"container-live-role" : "log"}, true);
    1.88 +      testAttrs("marqueeChild", {"container-live-role" : "marquee"}, true);
    1.89 +      testAttrs("statusChild", {"container-live-role" : "status"}, true);
    1.90 +      testAttrs("timerChild", {"container-live-role" : "timer"}, true);
    1.91 +      testAbsentAttrs("tablistChild", {"container-live-role" : "tablist"});
    1.92 +
    1.93 +      // absent aria-label and aria-labelledby object attribute
    1.94 +      testAbsentAttrs("label", {"label" : "foo"});
    1.95 +      testAbsentAttrs("labelledby", {"labelledby" : "label"});
    1.96 +
    1.97 +      // container that has no default live attribute
    1.98 +      testAttrs("liveGroup", {"live" : "polite"}, true);
    1.99 +      testAttrs("liveGroupChild", {"container-live" : "polite"}, true);
   1.100 +      testAttrs("liveGroup", {"container-live-role" : "group"}, true);
   1.101 +      testAttrs("liveGroupChild", {"container-live-role" : "group"}, true);
   1.102 +
   1.103 +      // text input type
   1.104 +      testAbsentAttrs("button", { "text-input-type": "button"});
   1.105 +      testAbsentAttrs("checkbox", { "text-input-type": "checkbox"});
   1.106 +      testAbsentAttrs("radio", { "text-input-type": "radio"});
   1.107 +      testAttrs("email", {"text-input-type" : "email"}, true);
   1.108 +      testAttrs("search", {"text-input-type" : "search"}, true);
   1.109 +      testAttrs("tel", {"text-input-type" : "tel"}, true);
   1.110 +      testAttrs("url", {"text-input-type" : "url"}, true);
   1.111 +
   1.112 +      // html
   1.113 +      testAttrs("radio", {"checkable" : "true"}, true); 
   1.114 +      testAttrs("checkbox", {"checkable" : "true"}, true); 
   1.115 +      testAttrs("draggable", {"draggable" : "true"}, true);
   1.116 +      testAttrs("th1", { "abbr": "SS#" }, true);
   1.117 +      testAttrs("th2", { "abbr": "SS#" }, true);
   1.118 +      testAttrs("th2", { "axis": "social" }, true);
   1.119 +
   1.120 +      // don't barf on an empty abbr element.
   1.121 +      testAbsentAttrs("th3", { "abbr": "" }, true);
   1.122 +
   1.123 +      // application accessible
   1.124 +      if (WIN) {
   1.125 +        var gfxInfo = Components.classes["@mozilla.org/gfx/info;1"].
   1.126 +          getService(Components.interfaces.nsIGfxInfo);
   1.127 +        var attrs = {
   1.128 +          "D2D": (gfxInfo.D2DEnabled ? "true" : "false")
   1.129 +        }
   1.130 +        testAttrs(getApplicationAccessible(), attrs, false);
   1.131 +      }
   1.132 +
   1.133 +      // no object attributes
   1.134 +      testAbsentAttrs(getAccessible("listitem").firstChild, { "tag": "" });
   1.135 +
   1.136 +      // experimental aria
   1.137 +      testAttrs("experimental", {"blah" : "true"}, true);
   1.138 +
   1.139 +      SimpleTest.finish();
   1.140 +    }
   1.141 +
   1.142 +    SimpleTest.waitForExplicitFinish();
   1.143 +    addA11yLoadEvent(doTest);
   1.144 +  </script>
   1.145 +</head>
   1.146 +<body>
   1.147 +  <a target="_blank"
   1.148 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=475006"
   1.149 +     title="Extend nsARIAMap to capture ARIA attribute characteristics">
   1.150 +    Mozilla Bug 475006
   1.151 +  </a>
   1.152 +  <a target="_blank"
   1.153 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=391829"
   1.154 +     title="Add support for container-live-role to object attributes">
   1.155 +    Mozilla Bug 391829
   1.156 +  </a>
   1.157 +  <a target="_blank"
   1.158 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=581952"
   1.159 +     title="Make explicit that aria-label is not an object attribute">
   1.160 +    Mozilla Bug 475006
   1.161 +  </a>
   1.162 +  <a target="_blank"
   1.163 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036"
   1.164 +     title="make HTML <output> accessible">
   1.165 +    Mozilla Bug 558036
   1.166 +  </a>
   1.167 +  <a target="_blank"
   1.168 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=896400"
   1.169 +     title="Tablist should no longer be an implicit live region">
   1.170 +    Mozilla Bug 896400
   1.171 +  </a>
   1.172 +  <a target="_blank"
   1.173 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=563862"
   1.174 +     title="Expand support for nsIAccessibleEvent::OBJECT_ATTRIBUTE_CHANGE">
   1.175 +    Mozilla Bug 563862
   1.176 +  </a>
   1.177 +  <a target="_blank"
   1.178 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=819303"
   1.179 +     title="crash in nsTextEquivUtils::AppendTextEquivFromTextContent">
   1.180 +    Mozilla Bug 819303
   1.181 +  </a>
   1.182 +  <a target="_blank"
   1.183 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=838407"
   1.184 +     title="aria-hidden false value shouldn't be exposed via object attributes">
   1.185 +    Mozilla Bug 838407
   1.186 +  </a>
   1.187 +  <p id="display"></p>
   1.188 +  <div id="content" style="display: none"></div>
   1.189 +  <pre id="test">
   1.190 +  </pre>
   1.191 +
   1.192 +  <!-- aria -->
   1.193 +  <div id="atomic" aria-atomic="true">live region</div>
   1.194 +  <div id="atomic_false" aria-atomic="false">live region</div>
   1.195 +  <div id="autocomplete" role="textbox" aria-autocomplete="true"></div>
   1.196 +  <div id="checkbox" role="checkbox"></div>
   1.197 +  <div id="checkedCheckbox" role="checkbox" aria-checked="true"></div>
   1.198 +  <div id="checkedMenuitem" role="menuitem" aria-checked="true"></div>
   1.199 +  <div id="checkedOption" role="option" aria-checked="true"></div>
   1.200 +  <div id="checkedRadio" role="radio" aria-checked="true"></div>
   1.201 +  <div id="checkedTreeitem" role="treeitem" aria-checked="true"></div>
   1.202 +  <div id="dropeffect" aria-dropeffect="copy"></div>
   1.203 +  <div id="grabbed" aria-grabbed="true"></div>
   1.204 +  <div id="hidden" aria-hidden="true"></div>
   1.205 +  <div id="hidden_false" aria-hidden="false"></div>
   1.206 +  <div id="sortAscending" role="columnheader" aria-sort="ascending"></div>
   1.207 +  <div id="sortDescending" role="columnheader" aria-sort="descending"></div>
   1.208 +  <div id="sortNone" role="columnheader" aria-sort="none"></div>
   1.209 +  <div id="sortOther" role="columnheader" aria-sort="other"></div>
   1.210 +
   1.211 +  <!-- inherited from iframe -->
   1.212 +  <iframe id="iframe" src="data:text/html,<html><body></body></html>"
   1.213 +          aria-busy="true"></iframe>
   1.214 +
   1.215 +  <!-- html -->
   1.216 +  <output id="output"></output>
   1.217 +
   1.218 +  <!-- back to aria -->
   1.219 +  <div id="live" aria-live="polite">excuse <div id="liveChild">me</div></div>
   1.220 +  <div id="live2" role="marquee" aria-live="polite">excuse <div id="live2Child">me</div></div>
   1.221 +  <div id="live3" role="region">excuse</div>
   1.222 +  <div id="log" role="log">excuse <div id="logChild">me</div></div>
   1.223 +  <div id="logAssertive" role="log" aria-live="assertive">excuse <div id="logAssertiveChild">me</div></div>
   1.224 +  <div id="marquee" role="marquee">excuse <div id="marqueeChild">me</div></div>
   1.225 +  <div id="status" role="status">excuse <div id="statusChild">me</div></div>
   1.226 +  <div id="tablist" role="tablist">tablist <div id="tablistChild">tab</div></div>
   1.227 +  <div id="timer" role="timer">excuse <div id="timerChild">me</div></div>
   1.228 +
   1.229 +  <!-- aria-label[ledby] should not be an object attribute -->
   1.230 +  <div id="label" role="checkbox" aria-label="foo"></div>
   1.231 +  <div id="labelledby" role="checkbox" aria-labelledby="label"></div>
   1.232 +
   1.233 +  <!-- unusual live case -->
   1.234 +  <div id="liveGroup" role="group" aria-live="polite">
   1.235 +    excuse <div id="liveGroupChild">me</div>
   1.236 +  </div>
   1.237 +
   1.238 +  <!-- text input type -->
   1.239 +  <input id="button" type="button"/>
   1.240 +  <input id="email" type="email"/>
   1.241 +  <input id="search" type="search"/>
   1.242 +  <input id="tel" type="tel"/>
   1.243 +  <input id="url" type="url"/>
   1.244 +
   1.245 +  <!-- html -->
   1.246 +  <input id="radio" type="radio"/>
   1.247 +  <input id="checkbox" type="checkbox"/>
   1.248 +  <div id="draggable" draggable="true">Draggable div</div>
   1.249 +  <table>
   1.250 +    <tr>
   1.251 +      <th id="th1"><abbr title="Social Security Number">SS#</abbr></th>
   1.252 +      <th id="th2" abbr="SS#" axis="social">Social Security Number</th>
   1.253 +      <th id="th3"><abbr></abbr></th>
   1.254 +    </tr>
   1.255 +  </table>
   1.256 +
   1.257 +  <ul>
   1.258 +    <li id="listitem">item
   1.259 +  </ul>
   1.260 +
   1.261 +  <!-- experimental aria -->
   1.262 +  <div id="experimental" aria-blah="true">Fake beer</div>
   1.263 +</body>
   1.264 +</html>

mercurial