accessible/tests/mochitest/tree/test_aria_imgmap.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_imgmap.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,108 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Test usemap elements and ARIA</title>
     1.8 +  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     1.9 +
    1.10 +  <script type="application/javascript"
    1.11 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <script type="application/javascript"
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
    1.14 +
    1.15 +  <script type="application/javascript"
    1.16 +          src="../common.js"></script>
    1.17 +  <script type="application/javascript"
    1.18 +          src="../role.js"></script>
    1.19 +  <script type="application/javascript"
    1.20 +          src="../events.js"></script>
    1.21 +  <script type="application/javascript"
    1.22 +          src="../states.js"></script>
    1.23 +
    1.24 +  <script type="application/javascript">
    1.25 +  //gA11yEventDumpToConsole = true;
    1.26 +  function doPreTest()
    1.27 +  {
    1.28 +    waitForImageMap("imagemap", doTest);
    1.29 +  }
    1.30 +
    1.31 +  function doTest()
    1.32 +  {
    1.33 +    var accTree = {
    1.34 +      role: ROLE_IMAGE_MAP,
    1.35 +      children: [
    1.36 +        {
    1.37 +          role: ROLE_ENTRY,
    1.38 +          name: "first name"
    1.39 +        },
    1.40 +        {
    1.41 +          role: ROLE_ENTRY,
    1.42 +          name: "last name"
    1.43 +        },
    1.44 +        {
    1.45 +          role: ROLE_RADIOBUTTON,
    1.46 +          name: "male"
    1.47 +        },
    1.48 +        {
    1.49 +          role: ROLE_RADIOBUTTON,
    1.50 +          name: "female"
    1.51 +        },
    1.52 +        {
    1.53 +          role: ROLE_CHECKBUTTON,
    1.54 +          name: "have bike"
    1.55 +        },
    1.56 +        {
    1.57 +          role: ROLE_COMBOBOX,
    1.58 +          name: "bike model"
    1.59 +        },
    1.60 +        {
    1.61 +          role: ROLE_CHECKBUTTON,
    1.62 +          name: "have car"
    1.63 +        },
    1.64 +        {
    1.65 +          role: ROLE_CHECKBUTTON,
    1.66 +          name: "have airplane"
    1.67 +        },
    1.68 +        {
    1.69 +          role: ROLE_PUSHBUTTON,
    1.70 +          name: "submit"
    1.71 +        }
    1.72 +      ]
    1.73 +    };
    1.74 +
    1.75 +    // Test image map tree structure, roles, and names.
    1.76 +    testAccessibleTree("imagemap", accTree);
    1.77 +
    1.78 +    SimpleTest.finish();
    1.79 +  }
    1.80 +
    1.81 +  SimpleTest.waitForExplicitFinish();
    1.82 +  addA11yLoadEvent(doPreTest);
    1.83 +  </script>
    1.84 +
    1.85 +</head>
    1.86 +<body>
    1.87 +
    1.88 +<a target="_blank"
    1.89 +  href="https://bugzilla.mozilla.org/show_bug.cgi?id=548291"
    1.90 +  title="Accessible tree of ARIA image maps">
    1.91 +Mozilla Bug 548291
    1.92 +</a>
    1.93 +<p id="display"></p>
    1.94 +<div id="content" style="display: none"></div>
    1.95 +<pre id="test">
    1.96 +</pre>
    1.97 +
    1.98 +<img id="imagemap" src="../formimage.png" width="219" height="229" border="0" usemap="#ariaMap">
    1.99 +<map id="ariaMap" name="ariaMap">
   1.100 +  <area id="t1" role="textbox" shape="rect" tabindex="0" alt="" title="first name"  coords="4,20,108,48" href="#" />
   1.101 +  <area id="t2" role="textbox" shape="rect" alt="" title="last name"  coords="111,21,215,50" href="#" />
   1.102 +  <area id="rb1" role="radio" aria-checked="true" shape="circle" alt="" title="male"  coords="60,75,11" href="#" />
   1.103 +  <area id="rb2" role="radio" shape="circle" alt="" title="female"  coords="73,94,11" href="#" />
   1.104 +  <area id="cb1" role="checkbox" aria-checked="true" shape="rect" alt="" title="have bike"  coords="95,123,118,145" href="#" />
   1.105 +  <area id="cbox" role="combobox" shape="rect" alt="" title="bike model"  coords="120,124,184,146" href="#" />
   1.106 +  <area id="cb2" role="checkbox" shape="rect" alt="" title="have car"  coords="90,145,114,164" href="#" />
   1.107 +  <area id="cb3" role="checkbox" shape="rect" alt="" title="have airplane"  coords="130,163,152,184" href="#" />
   1.108 +  <area id="b1" role="button" shape="rect" alt="" title="submit"  coords="4,198,67,224" href="#" />
   1.109 +</map>
   1.110 +</body>
   1.111 +</html>

mercurial