accessible/tests/mochitest/treeupdate/test_canvas.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/treeupdate/test_canvas.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,92 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +
     1.7 +<head>
     1.8 +  <title>Canvas subdom mutation</title>
     1.9 +
    1.10 +  <link rel="stylesheet" type="text/css"
    1.11 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.12 +
    1.13 +  <script type="application/javascript"
    1.14 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.15 +
    1.16 +  <script type="application/javascript"
    1.17 +          src="../common.js"></script>
    1.18 +  <script type="application/javascript"
    1.19 +          src="../role.js"></script>
    1.20 +  <script type="application/javascript"
    1.21 +          src="../events.js"></script>
    1.22 +
    1.23 +  <script type="application/javascript">
    1.24 +
    1.25 +    ////////////////////////////////////////////////////////////////////////////
    1.26 +    // Invokers
    1.27 +
    1.28 +    function addSubtree(aID)
    1.29 +    {
    1.30 +      this.node = getNode(aID);
    1.31 +
    1.32 +      this.eventSeq = [
    1.33 +        new invokerChecker(EVENT_SHOW, this.node)
    1.34 +      ];
    1.35 +
    1.36 +      this.invoke = function addSubtree_invoke()
    1.37 +      {
    1.38 +        // ensure we start with no subtree
    1.39 +        testAccessibleTree("canvas", { CANVAS: [] });
    1.40 +        getNode("dialog").style.display = "block";
    1.41 +      }
    1.42 +
    1.43 +      this.finalCheck = function addSubtree_finalCheck() {
    1.44 +        testAccessibleTree("dialog", { DIALOG: [] });
    1.45 +      }
    1.46 +
    1.47 +      this.getID = function addSubtree_getID()
    1.48 +      {
    1.49 +        return "show canvas subdom";
    1.50 +      }
    1.51 +    }
    1.52 +
    1.53 +    ////////////////////////////////////////////////////////////////////////////
    1.54 +    // Test
    1.55 +
    1.56 +    //gA11yEventDumpID = "eventdump"; // debug stuff
    1.57 +    //gA11yEventDumpToConsole = true;
    1.58 +
    1.59 +    var gQueue = null;
    1.60 +
    1.61 +    function doTest()
    1.62 +    {
    1.63 +      gQueue = new eventQueue();
    1.64 +
    1.65 +      // make the subdom come alive!
    1.66 +      gQueue.push(new addSubtree("dialog"));
    1.67 +
    1.68 +      gQueue.invoke(); // SimpleTest.finish() will be called in the end
    1.69 +    }
    1.70 +
    1.71 +    SimpleTest.waitForExplicitFinish();
    1.72 +    addA11yLoadEvent(doTest);
    1.73 +  </script>
    1.74 +</head>
    1.75 +<body>
    1.76 +
    1.77 +  <a target="_blank"
    1.78 +     title="Expose content in Canvas element"
    1.79 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=495912">
    1.80 +    Mozilla Bug 495912
    1.81 +  </a>
    1.82 +
    1.83 +  <p id="display"></p>
    1.84 +  <div id="content" style="display: none"></div>
    1.85 +  <pre id="test">
    1.86 +  </pre>
    1.87 +
    1.88 +  <canvas id="canvas">
    1.89 +    <div id="dialog" role="dialog" style="display: none;">
    1.90 +    </div>
    1.91 +  </canvas>
    1.92 +
    1.93 +  <div id="eventdump"></div>
    1.94 +</body>
    1.95 +</html>

mercurial