accessible/tests/mochitest/tree/test_aria_list.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/tree/test_aria_list.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,87 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>ARIA lists</title>
     1.8 +  <link rel="stylesheet" type="text/css"
     1.9 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.10 +
    1.11 +  <script type="application/javascript"
    1.12 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +
    1.14 +  <script type="application/javascript"
    1.15 +          src="../common.js"></script>
    1.16 +  <script type="application/javascript"
    1.17 +          src="../role.js"></script>
    1.18 +
    1.19 +  <script type="application/javascript">
    1.20 +    function doTest()
    1.21 +    {
    1.22 +      //////////////////////////////////////////////////////////////////////////
    1.23 +      // list
    1.24 +
    1.25 +      var accTree =
    1.26 +        { LIST: [
    1.27 +          { LISTITEM: [
    1.28 +            { TEXT_LEAF: [ ] }
    1.29 +          ] }
    1.30 +        ] };
    1.31 +
    1.32 +      testAccessibleTree("list", accTree);
    1.33 +
    1.34 +      //////////////////////////////////////////////////////////////////////////
    1.35 +      // crazy list (mad mix of ARIA and HTML)
    1.36 +
    1.37 +      accTree = { // div@role="list"
    1.38 +        role: ROLE_LIST,
    1.39 +        children: [
    1.40 +          { // li text leaf
    1.41 +             role: ROLE_TEXT_LEAF,
    1.42 +             name: "item1",
    1.43 +             children: [ ]
    1.44 +          },
    1.45 +          { // li@role="listitem"
    1.46 +            role: ROLE_LISTITEM,
    1.47 +            children: [
    1.48 +              { // text leaf
    1.49 +                role: ROLE_TEXT_LEAF,
    1.50 +                name: "item2",
    1.51 +                children: [ ]
    1.52 +              }
    1.53 +            ]
    1.54 +          }
    1.55 +        ]
    1.56 +      };
    1.57 +
    1.58 +      testAccessibleTree("crazy_list", accTree);
    1.59 +
    1.60 +      SimpleTest.finish();
    1.61 +    }
    1.62 +
    1.63 +    SimpleTest.waitForExplicitFinish();
    1.64 +    addA11yLoadEvent(doTest);
    1.65 +  </script>
    1.66 +</head>
    1.67 +<body>
    1.68 +
    1.69 +  <a target="_blank"
    1.70 +     title="Build the context dependent tree"
    1.71 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=804461">
    1.72 +    Mozilla Bug 804461
    1.73 +  </a>
    1.74 +  <p id="display"></p>
    1.75 +  <div id="content" style="display: none"></div>
    1.76 +  <pre id="test">
    1.77 +  </pre>
    1.78 +
    1.79 +  <div id="list" role="list">
    1.80 +    <div role="listitem">item1</div>
    1.81 +  </div>
    1.82 +
    1.83 +  <div id="crazy_list" role="list">
    1.84 +    <ul role="presentation">
    1.85 +      <li>item1</li>
    1.86 +      <li role="listitem">item2</li>
    1.87 +    </ul>
    1.88 +  </div>
    1.89 +</body>
    1.90 +</html>

mercurial