accessible/tests/mochitest/tree/test_aria_menu.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 <!DOCTYPE html>
     2 <html>
     3 <head>
     4   <title>Test accessible tree when ARIA role menuitem is used</title>
     5   <link rel="stylesheet" type="text/css"
     6         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     8   <script type="application/javascript"
     9           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    11   <script type="application/javascript"
    12           src="../common.js"></script>
    13   <script type="application/javascript"
    14           src="../role.js"></script>
    16   <script type="application/javascript">
    17   function doTest()
    18   {
    19     // Menuitem with no popup.
    20     tree =
    21       { SECTION: [ // container
    22         { MENUPOPUP: [ // menu
    23           { MENUITEM: [
    24             { STATICTEXT: [] }, // bullet
    25             { TEXT_LEAF: [] }
    26           ] }
    27         ] }
    28       ] }
    29     testAccessibleTree("menu", tree);
    31     // Menuitem with explicit no popup.
    32     tree =
    33       { SECTION: [ // container
    34         { MENUPOPUP: [ // menu
    35           { MENUITEM: [
    36             { STATICTEXT: [] }, // bullet
    37             { TEXT_LEAF: [] }
    38           ] }
    39         ] }
    40       ] }
    41     testAccessibleTree("menu_nopopup", tree);
    43     // Menuitem with popup.
    44     tree =
    45       { SECTION: [ // container
    46         { MENUPOPUP: [ // menu
    47           { PARENT_MENUITEM: [ // menuitem with aria-haspopup="true"
    48             { STATICTEXT: [] }, // bullet
    49             { TEXT_LEAF: [] }
    50           ] }
    51         ] }
    52       ] }
    53     testAccessibleTree("menu_popup", tree);
    55     SimpleTest.finish();
    56   }
    58   SimpleTest.waitForExplicitFinish();
    59   addA11yLoadEvent(doTest);
    60   </script>
    61 </head>
    62 <body>
    64   <a target="_blank"
    65      href="https://bugzilla.mozilla.org/show_bug.cgi?id=786566"
    66      title="ARIA menuitem acting as submenu should have PARENT_MENUITEM role">
    67     Mozilla Bug 786566
    68   </a>
    69   <p id="display"></p>
    70   <div id="content" style="display: none"></div>
    71   <pre id="test">
    72   </pre>
    74   <div id="menu">
    75     <ul role="menu">
    76       <li role="menuitem">Normal Menu</li>
    77     </ul>
    78   </div>
    80   <div id="menu_nopopup">
    81     <ul role="menu">
    82       <li role="menuitem" aria-haspopup="false">Menu with explicit no popup</li>
    83     </ul>
    84   </div>
    86   <div id="menu_popup">
    87     <ul role="menu">
    88       <li role="menuitem" aria-haspopup="true">Menu with popup</li>
    89     </ul>
    90   </div>
    92 </body>
    93 </html>

mercurial