accessible/tests/mochitest/attributes/test_obj.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <html>
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=475006
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=391829
     5 https://bugzilla.mozilla.org/show_bug.cgi?id=581952
     6 https://bugzilla.mozilla.org/show_bug.cgi?id=558036
     7 -->
     8 <head>
     9   <title>Group attributes tests</title>
    10   <link rel="stylesheet" type="text/css"
    11         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    13   <script type="application/javascript"
    14           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    16   <script type="application/javascript"
    17           src="../common.js"></script>
    18   <script type="application/javascript"
    19           src="../attributes.js"></script>
    21   <script type="application/javascript">
    22     function doTest()
    23     {
    24       // aria
    25       testAttrs("atomic", {"atomic" : "true", "container-atomic" : "true"}, true);
    26       testAttrs(getNode("atomic").firstChild, {"container-atomic" : "true"}, true);
    27       testAbsentAttrs("atomic_false", {"atomic" : "false", "container-atomic" : "false"});
    28       testAbsentAttrs(getNode("atomic_false").firstChild, {"container-atomic" : "false"});
    30       testAttrs("autocomplete", {"autocomplete" : "true"}, true);
    31       testAttrs("checkbox", {"checkable" : "true"}, true); 
    32       testAttrs("checkedCheckbox", {"checkable" : "true"}, true); 
    33       testAttrs("checkedMenuitem", {"checkable" : "true"}, true); 
    34       testAttrs("checkedOption", {"checkable" : "true"}, true); 
    35       testAttrs("checkedRadio", {"checkable" : "true"}, true); 
    36       testAttrs("checkedTreeitem", {"checkable" : "true"}, true); 
    37       testAttrs("dropeffect", {"dropeffect" : "copy"}, true);
    38       testAttrs("grabbed", {"grabbed" : "true"}, true);
    39       testAttrs("hidden", {"hidden" : "true"}, true);
    40       testAbsentAttrs("hidden_false", { "hidden": "false" });
    41       testAttrs("sortAscending", {"sort" : "ascending"}, true);
    42       testAttrs("sortDescending", {"sort" : "descending"}, true);
    43       testAttrs("sortNone", {"sort" : "none"}, true);
    44       testAttrs("sortOther", {"sort" : "other"}, true);
    46       // inherited attributes by subdocuments
    47       var subdoc = getAccessible("iframe").firstChild;
    48       testAttrs(subdoc, {"busy" : "true"}, true);
    50       // live object attribute
    52       // HTML
    53       testAttrs("output", {"live" : "polite"}, true);
    55       // ARIA
    56       testAttrs("live", {"live" : "polite"}, true);
    57       testAttrs("live2", {"live" : "polite"}, true);
    58       testAbsentAttrs("live3", {"live" : ""});
    59       testAttrs("log", {"live" : "polite"}, true);
    60       testAttrs("logAssertive", {"live" : "assertive"}, true);
    61       testAttrs("marquee", {"live" : "off"}, true);
    62       testAttrs("status", {"live" : "polite"}, true);
    63       testAttrs("timer", {"live" : "off"}, true);
    64       testAbsentAttrs("tablist", {"live" : "polite"});
    66       // container-live object attribute
    67       testAttrs("liveChild", {"container-live" : "polite"}, true);
    68       testAttrs("live2Child", {"container-live" : "polite"}, true);
    69       testAttrs("logChild", {"container-live" : "polite"}, true);
    70       testAttrs("logAssertiveChild", {"container-live" : "assertive"}, true);
    71       testAttrs("marqueeChild", {"container-live" : "off"}, true);
    72       testAttrs("statusChild", {"container-live" : "polite"}, true);
    73       testAttrs("timerChild", {"container-live" : "off"}, true);
    74       testAbsentAttrs("tablistChild", {"container-live" : "polite"});
    76       // container-live-role object attribute
    77       testAttrs("log", {"container-live-role" : "log"}, true);
    78       testAttrs("logAssertive", {"container-live-role" : "log"}, true);
    79       testAttrs("marquee", {"container-live-role" : "marquee"}, true);
    80       testAttrs("status", {"container-live-role" : "status"}, true);
    81       testAttrs("timer", {"container-live-role" : "timer"}, true);
    82       testAttrs("logChild", {"container-live-role" : "log"}, true);
    83       testAttrs("logAssertive", {"container-live-role" : "log"}, true);
    84       testAttrs("logAssertiveChild", {"container-live-role" : "log"}, true);
    85       testAttrs("marqueeChild", {"container-live-role" : "marquee"}, true);
    86       testAttrs("statusChild", {"container-live-role" : "status"}, true);
    87       testAttrs("timerChild", {"container-live-role" : "timer"}, true);
    88       testAbsentAttrs("tablistChild", {"container-live-role" : "tablist"});
    90       // absent aria-label and aria-labelledby object attribute
    91       testAbsentAttrs("label", {"label" : "foo"});
    92       testAbsentAttrs("labelledby", {"labelledby" : "label"});
    94       // container that has no default live attribute
    95       testAttrs("liveGroup", {"live" : "polite"}, true);
    96       testAttrs("liveGroupChild", {"container-live" : "polite"}, true);
    97       testAttrs("liveGroup", {"container-live-role" : "group"}, true);
    98       testAttrs("liveGroupChild", {"container-live-role" : "group"}, true);
   100       // text input type
   101       testAbsentAttrs("button", { "text-input-type": "button"});
   102       testAbsentAttrs("checkbox", { "text-input-type": "checkbox"});
   103       testAbsentAttrs("radio", { "text-input-type": "radio"});
   104       testAttrs("email", {"text-input-type" : "email"}, true);
   105       testAttrs("search", {"text-input-type" : "search"}, true);
   106       testAttrs("tel", {"text-input-type" : "tel"}, true);
   107       testAttrs("url", {"text-input-type" : "url"}, true);
   109       // html
   110       testAttrs("radio", {"checkable" : "true"}, true); 
   111       testAttrs("checkbox", {"checkable" : "true"}, true); 
   112       testAttrs("draggable", {"draggable" : "true"}, true);
   113       testAttrs("th1", { "abbr": "SS#" }, true);
   114       testAttrs("th2", { "abbr": "SS#" }, true);
   115       testAttrs("th2", { "axis": "social" }, true);
   117       // don't barf on an empty abbr element.
   118       testAbsentAttrs("th3", { "abbr": "" }, true);
   120       // application accessible
   121       if (WIN) {
   122         var gfxInfo = Components.classes["@mozilla.org/gfx/info;1"].
   123           getService(Components.interfaces.nsIGfxInfo);
   124         var attrs = {
   125           "D2D": (gfxInfo.D2DEnabled ? "true" : "false")
   126         }
   127         testAttrs(getApplicationAccessible(), attrs, false);
   128       }
   130       // no object attributes
   131       testAbsentAttrs(getAccessible("listitem").firstChild, { "tag": "" });
   133       // experimental aria
   134       testAttrs("experimental", {"blah" : "true"}, true);
   136       SimpleTest.finish();
   137     }
   139     SimpleTest.waitForExplicitFinish();
   140     addA11yLoadEvent(doTest);
   141   </script>
   142 </head>
   143 <body>
   144   <a target="_blank"
   145      href="https://bugzilla.mozilla.org/show_bug.cgi?id=475006"
   146      title="Extend nsARIAMap to capture ARIA attribute characteristics">
   147     Mozilla Bug 475006
   148   </a>
   149   <a target="_blank"
   150      href="https://bugzilla.mozilla.org/show_bug.cgi?id=391829"
   151      title="Add support for container-live-role to object attributes">
   152     Mozilla Bug 391829
   153   </a>
   154   <a target="_blank"
   155      href="https://bugzilla.mozilla.org/show_bug.cgi?id=581952"
   156      title="Make explicit that aria-label is not an object attribute">
   157     Mozilla Bug 475006
   158   </a>
   159   <a target="_blank"
   160      href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036"
   161      title="make HTML <output> accessible">
   162     Mozilla Bug 558036
   163   </a>
   164   <a target="_blank"
   165      href="https://bugzilla.mozilla.org/show_bug.cgi?id=896400"
   166      title="Tablist should no longer be an implicit live region">
   167     Mozilla Bug 896400
   168   </a>
   169   <a target="_blank"
   170      href="https://bugzilla.mozilla.org/show_bug.cgi?id=563862"
   171      title="Expand support for nsIAccessibleEvent::OBJECT_ATTRIBUTE_CHANGE">
   172     Mozilla Bug 563862
   173   </a>
   174   <a target="_blank"
   175      href="https://bugzilla.mozilla.org/show_bug.cgi?id=819303"
   176      title="crash in nsTextEquivUtils::AppendTextEquivFromTextContent">
   177     Mozilla Bug 819303
   178   </a>
   179   <a target="_blank"
   180      href="https://bugzilla.mozilla.org/show_bug.cgi?id=838407"
   181      title="aria-hidden false value shouldn't be exposed via object attributes">
   182     Mozilla Bug 838407
   183   </a>
   184   <p id="display"></p>
   185   <div id="content" style="display: none"></div>
   186   <pre id="test">
   187   </pre>
   189   <!-- aria -->
   190   <div id="atomic" aria-atomic="true">live region</div>
   191   <div id="atomic_false" aria-atomic="false">live region</div>
   192   <div id="autocomplete" role="textbox" aria-autocomplete="true"></div>
   193   <div id="checkbox" role="checkbox"></div>
   194   <div id="checkedCheckbox" role="checkbox" aria-checked="true"></div>
   195   <div id="checkedMenuitem" role="menuitem" aria-checked="true"></div>
   196   <div id="checkedOption" role="option" aria-checked="true"></div>
   197   <div id="checkedRadio" role="radio" aria-checked="true"></div>
   198   <div id="checkedTreeitem" role="treeitem" aria-checked="true"></div>
   199   <div id="dropeffect" aria-dropeffect="copy"></div>
   200   <div id="grabbed" aria-grabbed="true"></div>
   201   <div id="hidden" aria-hidden="true"></div>
   202   <div id="hidden_false" aria-hidden="false"></div>
   203   <div id="sortAscending" role="columnheader" aria-sort="ascending"></div>
   204   <div id="sortDescending" role="columnheader" aria-sort="descending"></div>
   205   <div id="sortNone" role="columnheader" aria-sort="none"></div>
   206   <div id="sortOther" role="columnheader" aria-sort="other"></div>
   208   <!-- inherited from iframe -->
   209   <iframe id="iframe" src="data:text/html,<html><body></body></html>"
   210           aria-busy="true"></iframe>
   212   <!-- html -->
   213   <output id="output"></output>
   215   <!-- back to aria -->
   216   <div id="live" aria-live="polite">excuse <div id="liveChild">me</div></div>
   217   <div id="live2" role="marquee" aria-live="polite">excuse <div id="live2Child">me</div></div>
   218   <div id="live3" role="region">excuse</div>
   219   <div id="log" role="log">excuse <div id="logChild">me</div></div>
   220   <div id="logAssertive" role="log" aria-live="assertive">excuse <div id="logAssertiveChild">me</div></div>
   221   <div id="marquee" role="marquee">excuse <div id="marqueeChild">me</div></div>
   222   <div id="status" role="status">excuse <div id="statusChild">me</div></div>
   223   <div id="tablist" role="tablist">tablist <div id="tablistChild">tab</div></div>
   224   <div id="timer" role="timer">excuse <div id="timerChild">me</div></div>
   226   <!-- aria-label[ledby] should not be an object attribute -->
   227   <div id="label" role="checkbox" aria-label="foo"></div>
   228   <div id="labelledby" role="checkbox" aria-labelledby="label"></div>
   230   <!-- unusual live case -->
   231   <div id="liveGroup" role="group" aria-live="polite">
   232     excuse <div id="liveGroupChild">me</div>
   233   </div>
   235   <!-- text input type -->
   236   <input id="button" type="button"/>
   237   <input id="email" type="email"/>
   238   <input id="search" type="search"/>
   239   <input id="tel" type="tel"/>
   240   <input id="url" type="url"/>
   242   <!-- html -->
   243   <input id="radio" type="radio"/>
   244   <input id="checkbox" type="checkbox"/>
   245   <div id="draggable" draggable="true">Draggable div</div>
   246   <table>
   247     <tr>
   248       <th id="th1"><abbr title="Social Security Number">SS#</abbr></th>
   249       <th id="th2" abbr="SS#" axis="social">Social Security Number</th>
   250       <th id="th3"><abbr></abbr></th>
   251     </tr>
   252   </table>
   254   <ul>
   255     <li id="listitem">item
   256   </ul>
   258   <!-- experimental aria -->
   259   <div id="experimental" aria-blah="true">Fake beer</div>
   260 </body>
   261 </html>

mercurial