accessible/tests/mochitest/tree/test_aria_list.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4   <title>ARIA lists</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       //////////////////////////////////////////////////////////////////////////
    20       // list
    22       var accTree =
    23         { LIST: [
    24           { LISTITEM: [
    25             { TEXT_LEAF: [ ] }
    26           ] }
    27         ] };
    29       testAccessibleTree("list", accTree);
    31       //////////////////////////////////////////////////////////////////////////
    32       // crazy list (mad mix of ARIA and HTML)
    34       accTree = { // div@role="list"
    35         role: ROLE_LIST,
    36         children: [
    37           { // li text leaf
    38              role: ROLE_TEXT_LEAF,
    39              name: "item1",
    40              children: [ ]
    41           },
    42           { // li@role="listitem"
    43             role: ROLE_LISTITEM,
    44             children: [
    45               { // text leaf
    46                 role: ROLE_TEXT_LEAF,
    47                 name: "item2",
    48                 children: [ ]
    49               }
    50             ]
    51           }
    52         ]
    53       };
    55       testAccessibleTree("crazy_list", accTree);
    57       SimpleTest.finish();
    58     }
    60     SimpleTest.waitForExplicitFinish();
    61     addA11yLoadEvent(doTest);
    62   </script>
    63 </head>
    64 <body>
    66   <a target="_blank"
    67      title="Build the context dependent tree"
    68      href="https://bugzilla.mozilla.org/show_bug.cgi?id=804461">
    69     Mozilla Bug 804461
    70   </a>
    71   <p id="display"></p>
    72   <div id="content" style="display: none"></div>
    73   <pre id="test">
    74   </pre>
    76   <div id="list" role="list">
    77     <div role="listitem">item1</div>
    78   </div>
    80   <div id="crazy_list" role="list">
    81     <ul role="presentation">
    82       <li>item1</li>
    83       <li role="listitem">item2</li>
    84     </ul>
    85   </div>
    86 </body>
    87 </html>

mercurial