tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_xml-roles.html (9756B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4  <title>XML roles tests</title>
      5  <link rel="stylesheet" type="text/css"
      6        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
      7 
      8  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
      9 
     10  <script type="application/javascript"
     11          src="../common.js"></script>
     12  <script type="application/javascript"
     13          src="../role.js"></script>
     14  <script type="application/javascript"
     15          src="../attributes.js"></script>
     16 
     17  <script type="application/javascript">
     18 
     19    function doTest() {
     20      // Some AT may look for this
     21      testAttrs("nav", {"xml-roles": "navigation"}, true);
     22      testAttrs("header", {"xml-roles": "banner"}, true);
     23      testAbsentAttrs("article_header", {"xml-roles": "banner"});
     24      testAbsentAttrs("main_header", {"xml-roles": "banner"});
     25      testAbsentAttrs("section_header", {"xml-roles": "banner"});
     26      testAttrs("footer", {"xml-roles": "contentinfo"}, true);
     27      testAbsentAttrs("article_footer", {"xml-roles": "contentinfo"});
     28      testAbsentAttrs("main_footer", {"xml-roles": "contentinfo"});
     29      testAbsentAttrs("section_footer", {"xml-roles": "contentinfo"});
     30      testAttrs("aside", {"xml-roles": "complementary"}, true);
     31      testAbsentAttrs("section", {"xml-roles": "region"});
     32      testAttrs("main", {"xml-roles": "main"}, true); // // ARIA override
     33      testAttrs("form", {"xml-roles": "form"}, true);
     34      testAttrs("feed", {"xml-roles": "feed"}, true);
     35      testAttrs("article", {"xml-roles": "article"}, true);
     36      testAttrs("main_element", {"xml-roles": "main"}, true);
     37      testAttrs("figure", {"xml-roles": "figure"}, true);
     38 
     39      testAttrs("search", {"xml-roles": "searchbox"}, true);
     40 
     41      testAttrs("code", {"xml-roles": "code"}, true);
     42 
     43      testAttrs("open-1", {"xml-roles": "open-fence"}, true);
     44      testAttrs("open-2", {"xml-roles": "open-fence"}, true);
     45      testAttrs("open-3", {"xml-roles": "open-fence"}, true);
     46      testAttrs("open-4", {"xml-roles": "open-fence"}, true);
     47      testAttrs("open-5", {"xml-roles": "open-fence"}, true);
     48      testAttrs("open-6", {"xml-roles": "open-fence"}, true);
     49      testAttrs("open-7", {"xml-roles": "open-fence"}, true);
     50 
     51      testAttrs("sep-1", {"xml-roles": "separator"}, true);
     52      testAttrs("sep-2", {"xml-roles": "separator"}, true);
     53      testAttrs("sep-3", {"xml-roles": "separator"}, true);
     54      testAttrs("sep-4", {"xml-roles": "separator"}, true);
     55      testAttrs("sep-5", {"xml-roles": "separator"}, true);
     56      testAttrs("sep-6", {"xml-roles": "separator"}, true);
     57      testAttrs("sep-7", {"xml-roles": "separator"}, true);
     58 
     59      testAttrs("close-1", {"xml-roles": "close-fence"}, true);
     60      testAttrs("close-2", {"xml-roles": "close-fence"}, true);
     61      testAttrs("close-3", {"xml-roles": "close-fence"}, true);
     62      testAttrs("close-4", {"xml-roles": "close-fence"}, true);
     63      testAttrs("close-5", {"xml-roles": "close-fence"}, true);
     64      testAttrs("close-6", {"xml-roles": "close-fence"}, true);
     65      testAttrs("close-7", {"xml-roles": "close-fence"}, true);
     66 
     67      testAttrs("num", {"xml-roles": "numerator"}, true);
     68      testAttrs("den", {"xml-roles": "denominator"}, true);
     69 
     70      testAttrs("sub-1", {"xml-roles": "subscript"}, true);
     71      testAttrs("sub-2", {"xml-roles": "subscript"}, true);
     72      testAttrs("sub-3", {"xml-roles": "subscript"}, true);
     73      testAttrs("sup-1", {"xml-roles": "superscript"}, true);
     74      testAttrs("sup-2", {"xml-roles": "superscript"}, true);
     75      testAttrs("sup-3", {"xml-roles": "superscript"}, true);
     76      testAttrs("sup-4", {"xml-roles": "superscript"}, true);
     77      testAttrs("presub-1", {"xml-roles": "presubscript"}, true);
     78      testAttrs("presub-2", {"xml-roles": "presubscript"}, true);
     79      testAttrs("presup-1", {"xml-roles": "presuperscript"}, true);
     80 
     81      testAttrs("under-1", {"xml-roles": "underscript"}, true);
     82      testAttrs("under-2", {"xml-roles": "underscript"}, true);
     83      testAttrs("over-1", {"xml-roles": "overscript"}, true);
     84      testAttrs("over-2", {"xml-roles": "overscript"}, true);
     85 
     86      testAttrs("root-index-1", {"xml-roles": "root-index"}, true);
     87 
     88      testAttrs("base-1", {"xml-roles": "base"}, true);
     89      testAttrs("base-2", {"xml-roles": "base"}, true);
     90      testAttrs("base-3", {"xml-roles": "base"}, true);
     91      testAttrs("base-4", {"xml-roles": "base"}, true);
     92      testAttrs("base-5", {"xml-roles": "base"}, true);
     93      testAttrs("base-6", {"xml-roles": "base"}, true);
     94      testAttrs("base-7", {"xml-roles": "base"}, true);
     95      testAttrs("base-8", {"xml-roles": "base"}, true);
     96 
     97      SimpleTest.finish();
     98    }
     99 
    100    SimpleTest.waitForExplicitFinish();
    101    addA11yLoadEvent(doTest);
    102  </script>
    103 </head>
    104 <body>
    105 
    106  <a target="_blank"
    107     title="Provide mappings for html5 <nav> <header> <footer> <article>"
    108     href="https://bugzilla.mozilla.org/show_bug.cgi?id=593368">
    109    Bug 593368
    110  </a><br/>
    111  <a target="_blank"
    112     href="https://bugzilla.mozilla.org/show_bug.cgi?id=613502"
    113     title="Map <article> like we do aria role article">
    114    Bug 613502
    115  </a>
    116  <a target="_blank"
    117     href="https://bugzilla.mozilla.org/show_bug.cgi?id=610650"
    118     title="Change implementation of HTML5 landmark elements to conform">
    119    Bug 610650
    120  </a>
    121  <a target="_blank"
    122     href="https://bugzilla.mozilla.org/show_bug.cgi?id=614310"
    123     title="Map section to pane (like role=region)">
    124    Mozilla Bug 614310
    125  </a>
    126  <a target="_blank"
    127     href="https://bugzilla.mozilla.org/show_bug.cgi?id=734982"
    128     title="Map ARIA role FORM">
    129    Bug 734982
    130  </a>
    131  <a target="_blank"
    132     href="https://bugzilla.mozilla.org/show_bug.cgi?id=761891"
    133     title="HTML5 article element should expose xml-roles:article object attribute">
    134    Bug 761891
    135  </a>
    136  <a target="_blank"
    137     href="https://bugzilla.mozilla.org/show_bug.cgi?id=849624"
    138     title="modify HTML5 header and footer accessibility API mapping">
    139    Bug 849624
    140  </a>
    141  <a target="_blank"
    142     href="https://bugzilla.mozilla.org/show_bug.cgi?id=1121518"
    143     title="ARIA 1.1: Support role 'searchbox'">
    144    Bug 1121518
    145  </a>
    146  <a target="_blank"
    147     href="https://bugzilla.mozilla.org/show_bug.cgi?id=1356049"
    148     title="Map ARIA figure role">
    149    Bug 1356049
    150  </a>
    151 
    152  <p id="display"></p>
    153  <div id="content" style="display: none"></div>
    154  <pre id="test">
    155  </pre>
    156 
    157  <nav id="nav">a nav</nav>
    158  <header id="header">a header</header>
    159  <footer id="footer">a footer</footer>
    160  <article id="article_with_header_and_footer">
    161    <header id="article_header">a header within an article</header>
    162    <footer id="article_footer">a footer within an article</footer>
    163  </article>
    164  <main id="main_with_header_and_footer">
    165    <header id="main_header">a header within a main</header>
    166    <footer id="main_footer">a footer within a main</footer>
    167  </main>
    168  <section id="section_with_header_and_footer">
    169    <header id="section_header">a header within an section</header>
    170    <footer id="section_footer">a footer within an section</footer>
    171  </section>
    172  <aside id="aside">by the way I am an aside</aside>
    173  <section id="section">a section</section>
    174  <article id="main" role="main">a main area</article>
    175  <article id="form" role="form">a form area</article>
    176  <div id="feed" role="feed">a feed</div>
    177  <article id="article">article</article>
    178  <main id="main_element">another main area</main>
    179  <div id="figure" role="figure">a figure</div>
    180 
    181  <input id="search" type="search"/>
    182 
    183  <div id="code" role="code"></div>
    184 
    185  <!-- open-fence, separator, close-fence -->
    186  <math><mo id="open-1">(</mo><mi>x</mi><mo id="sep-1">,</mo><mi>y</mi><mo id="close-1">)</mo></math>
    187  <math><mrow><mo id="open-2">(</mo><mi>x</mi><mo id="sep-2">,</mo><mi>y</mi><mo id="close-2">)</mo></mrow></math>
    188  <math><mstyle><mo id="open-3">(</mo><mi>x</mi><mo id="sep-3">,</mo><mi>y</mi><mo id="close-3">)</mo></mstyle></math>
    189  <math><msqrt><mo id="open-4">(</mo><mi>x</mi><mo id="sep-4">,</mo><mi>y</mi><mo id="close-4">)</mo></msqrt></math>
    190  <math><menclose><mo id="open-5">(</mo><mi>x</mi><mo id="sep-5">,</mo><mi>y</mi><mo id="close-5">)</mo></menclose></math>
    191  <math><merror><mo id="open-6">(</mo><mi>x</mi><mo id="sep-6">,</mo><mi>y</mi><mo id="close-6">)</mo></merror></math>
    192  <math><mtable><mtr><mtd><mo id="open-7">(</mo><mi>x</mi><mo id="sep-7">,</mo><mi>y</mi><mo id="close-7">)</mo></mtd></mtr></mtable></math>
    193 
    194  <!-- numerator, denominator -->
    195  <math>
    196    <mfrac>
    197      <mi id="num">a</mi>
    198      <mi id="den">b</mi>
    199    </mfrac>
    200  </math>
    201 
    202  <!-- subscript, superscript, presubscript, presuperscript -->
    203  <math>
    204    <msub>
    205      <mi id="base-1">a</mi>
    206      <mi id="sub-1">b</mi>
    207    </msub>
    208  </math>
    209  <math>
    210    <msup>
    211      <mi id="base-2">a</mi>
    212      <mi id="sup-1">b</mi>
    213    </msup>
    214  </math>
    215  <math>
    216    <msubsup>
    217      <mi id="base-3">a</mi>
    218      <mi id="sub-2">b</mi>
    219      <mi id="sup-2">c</mi>
    220    </msubsup>
    221  </math>
    222  <math>
    223    <mmultiscripts>
    224      <mi id="base-4">a</mi>
    225      <mi id="sub-3">b</mi>
    226      <mi id="sup-3">c</mi>
    227      <none/>
    228      <mi id="sup-4">d</mi>
    229      <mprescripts/>
    230      <mi id="presub-1">e</mi>
    231      <none/>
    232      <mi id="presub-2">f</mi>
    233      <mi id="presup-1">g</mi>
    234    </mmultiscripts>
    235  </math>
    236 
    237  <!-- underscript, overscript -->
    238  <math>
    239    <munder>
    240      <mi id="base-5">a</mi>
    241      <mi id="under-1">b</mi>
    242    </munder>
    243  </math>
    244  <math>
    245    <mover>
    246      <mi id="base-6">a</mi>
    247      <mi id="over-1">b</mi>
    248    </mover>
    249  </math>
    250  <math>
    251    <munderover>
    252      <mi id="base-7">a</mi>
    253      <mi id="under-2">b</mi>
    254      <mi id="over-2">c</mi>
    255    </munderover>
    256  </math>
    257 
    258  <!-- root-index -->
    259  <math>
    260    <mroot>
    261      <mi id="base-8">a</mi>
    262      <mi id="root-index-1">b</mi>
    263    </mroot>
    264  </math>
    265 
    266 </body>
    267 </html>