accessible/tests/mochitest/treeupdate/test_canvas.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <!DOCTYPE html>
     2 <html>
     4 <head>
     5   <title>Canvas subdom mutation</title>
     7   <link rel="stylesheet" type="text/css"
     8         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    10   <script type="application/javascript"
    11           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    13   <script type="application/javascript"
    14           src="../common.js"></script>
    15   <script type="application/javascript"
    16           src="../role.js"></script>
    17   <script type="application/javascript"
    18           src="../events.js"></script>
    20   <script type="application/javascript">
    22     ////////////////////////////////////////////////////////////////////////////
    23     // Invokers
    25     function addSubtree(aID)
    26     {
    27       this.node = getNode(aID);
    29       this.eventSeq = [
    30         new invokerChecker(EVENT_SHOW, this.node)
    31       ];
    33       this.invoke = function addSubtree_invoke()
    34       {
    35         // ensure we start with no subtree
    36         testAccessibleTree("canvas", { CANVAS: [] });
    37         getNode("dialog").style.display = "block";
    38       }
    40       this.finalCheck = function addSubtree_finalCheck() {
    41         testAccessibleTree("dialog", { DIALOG: [] });
    42       }
    44       this.getID = function addSubtree_getID()
    45       {
    46         return "show canvas subdom";
    47       }
    48     }
    50     ////////////////////////////////////////////////////////////////////////////
    51     // Test
    53     //gA11yEventDumpID = "eventdump"; // debug stuff
    54     //gA11yEventDumpToConsole = true;
    56     var gQueue = null;
    58     function doTest()
    59     {
    60       gQueue = new eventQueue();
    62       // make the subdom come alive!
    63       gQueue.push(new addSubtree("dialog"));
    65       gQueue.invoke(); // SimpleTest.finish() will be called in the end
    66     }
    68     SimpleTest.waitForExplicitFinish();
    69     addA11yLoadEvent(doTest);
    70   </script>
    71 </head>
    72 <body>
    74   <a target="_blank"
    75      title="Expose content in Canvas element"
    76      href="https://bugzilla.mozilla.org/show_bug.cgi?id=495912">
    77     Mozilla Bug 495912
    78   </a>
    80   <p id="display"></p>
    81   <div id="content" style="display: none"></div>
    82   <pre id="test">
    83   </pre>
    85   <canvas id="canvas">
    86     <div id="dialog" role="dialog" style="display: none;">
    87     </div>
    88   </canvas>
    90   <div id="eventdump"></div>
    91 </body>
    92 </html>

mercurial