summaryrefslogtreecommitdiffstats
path: root/accessible/tests/mochitest/value/test_ariavalue.html
blob: fa240e082e31f35ffbb214855f516f995ab8bb3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<html>

<head>
  <title>nsIAccessible value testing for implicit aria-value* attributes</title>

  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />

  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>

  <script type="application/javascript" src="../common.js"></script>
  <script type="application/javascript" src="../value.js"></script>

  <script src="chrome://mochikit/content/chrome-harness.js"></script>

  <script type="application/javascript">
    function doTest() {
      for (const role of ["slider", "scrollbar"]) {
        testValue(`${role}_default`, "50", 50, 0, 100, 0);
        testValue(`${role}_min1max50`, "25.5", 25.5, 1, 50, 0);
        testValue(`${role}_max200`, "100", 100, 0, 200, 0);
        testValue(`${role}_min10`, "55", 55, 10, 100, 0);
        testValue(`${role}_vt`, "juice", 50, 0, 100, 0);
        testValue(`${role}_vn`, "6", 6, 0, 100, 0);
        testValue(`${role}_vtvn`, "juice", 6, 0, 100, 0);
      }

      SimpleTest.finish();
    }

    SimpleTest.waitForExplicitFinish();
    addA11yLoadEvent(doTest);
  </script>

</head>

<body>

  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1357071"
    title="Add support for implicit values for aria-value* attributes for scrollbar and slider roles">
    Bug 1357071
  </a>

  <p id="display"></p>
  <div id="content" style="display: none">
  </div>
  <pre id="test">
  </pre>

  <!-- ARIA sliders -->
  <div id="slider_default" role="slider">vanilla slider</div>
  <div id="slider_min1max50" role="slider" aria-valuemin="1" aria-valuemax="50">banana slider</div>
  <div id="slider_max200" role="slider" aria-valuemax="200">cherry slider</div>
  <div id="slider_min10" role="slider" aria-valuemin="10">strawberry slider</div>
  <div id="slider_vt" role="slider" aria-valuetext="juice">orange slider</div>
  <div id="slider_vn" role="slider" aria-valuenow="6">chocolate slider</div>
  <div id="slider_vtvn" role="slider" aria-valuetext="juice" aria-valuenow="6">apple slider</div>

  <!-- ARIA scrollbars -->
  <div id="scrollbar_default" role="scrollbar">vanilla scrollbar</div>
  <div id="scrollbar_min1max50" role="scrollbar" aria-valuemin="1" aria-valuemax="50">banana scrollbar</div>
  <div id="scrollbar_max200" role="scrollbar" aria-valuemax="200">cherry scrollbar</div>
  <div id="scrollbar_min10" role="scrollbar" aria-valuemin="10">strawberry scrollbar</div>
  <div id="scrollbar_vt" role="scrollbar" aria-valuetext="juice">orange scrollbar</div>
  <div id="scrollbar_vn" role="scrollbar" aria-valuenow="6">chocolate scrollbar</div>
  <div id="scrollbar_vtvn" role="scrollbar" aria-valuetext="juice" aria-valuenow="6">apple scrollbar</div>
</body>

</html>