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