accessible/tests/mochitest/events/test_aria_objattr.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/events/test_aria_objattr.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,99 @@
     1.4 +<html>
     1.5 +
     1.6 +<head>
     1.7 +  <title>Accessible ARIA object attribute changes</title>
     1.8 +
     1.9 +  <link rel="stylesheet" type="text/css"
    1.10 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.11 +
    1.12 +  <script type="application/javascript"
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.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="../events.js"></script>
    1.19 +
    1.20 +  <script type="application/javascript">
    1.21 +
    1.22 +    /**
    1.23 +     * Do tests.
    1.24 +     */
    1.25 +    var gQueue = null;
    1.26 +
    1.27 +    function updateAttribute(aID, aAttr, aValue)
    1.28 +    {
    1.29 +      this.node = getNode(aID);
    1.30 +      this.accessible = getAccessible(this.node);
    1.31 +
    1.32 +      this.eventSeq = [
    1.33 +        new invokerChecker(EVENT_OBJECT_ATTRIBUTE_CHANGED, this.accessible),
    1.34 +      ];
    1.35 +
    1.36 +      this.invoke = function updateAttribute_invoke()
    1.37 +      {
    1.38 +        this.node.setAttribute(aAttr, aValue);
    1.39 +      }
    1.40 +
    1.41 +      this.getID = function updateAttribute_getID()
    1.42 +      {
    1.43 +        return aAttr + " for " + aID + " " + aValue;
    1.44 +      }
    1.45 +    }
    1.46 +
    1.47 +    // Debug stuff.
    1.48 +    // gA11yEventDumpID = "eventdump";
    1.49 +    //gA11yEventDumpToConsole = true;
    1.50 +
    1.51 +    function doTests()
    1.52 +    {
    1.53 +      gQueue = new eventQueue();
    1.54 +
    1.55 +      gQueue.push(new updateAttribute("hideable", "aria-hidden", "true"));
    1.56 +
    1.57 +      gQueue.push(new updateAttribute("sortable", "aria-sort", "ascending"));
    1.58 +
    1.59 +      // For experimental ARIA extensions
    1.60 +      gQueue.push(new updateAttribute("custom", "aria-blah", "true"));
    1.61 +
    1.62 +      gQueue.invoke(); // Will call SimpleTest.finish();
    1.63 +    }
    1.64 +
    1.65 +    SimpleTest.waitForExplicitFinish();
    1.66 +    addA11yLoadEvent(doTests);
    1.67 +  </script>
    1.68 +</head>
    1.69 +
    1.70 +<body>
    1.71 +
    1.72 +  <a target="_blank"
    1.73 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=581096"
    1.74 +     title="Add support for aria-hidden">
    1.75 +    Mozilla Bug 581096
    1.76 +  </a>
    1.77 +
    1.78 +  <a target="_blank"
    1.79 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=640707"
    1.80 +     title="Add event support for aria-sort">
    1.81 +    Mozilla Bug 640707
    1.82 +  </a>
    1.83 +
    1.84 +  <a target="_blank"
    1.85 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=640707"
    1.86 +     title="Expand support for aria attribute change events">
    1.87 +    Mozilla Bug 563862
    1.88 +  </a>
    1.89 +
    1.90 +  <p id="display"></p>
    1.91 +  <div id="content" style="display: none"></div>
    1.92 +  <pre id="test">
    1.93 +  </pre>
    1.94 +  <div id="eventdump"></div>
    1.95 +
    1.96 +  <div id="hideable"><div>Hi</div><div>there</div></div>
    1.97 +
    1.98 +  <div id="sortable" role="columnheader" aria-sort="none">aria-sort</div>
    1.99 +
   1.100 +  <div id="custom" role="custom" aria-blah="false">Fat free cheese</div>
   1.101 +</body>
   1.102 +</html>

mercurial