OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script> | |
4 if (window.testRunner) | |
5 testRunner.dumpAsText(); | |
6 | |
7 function log(msg) | |
8 { | |
9 document.getElementById('console').appendChild(document.createTextNode(msg +
"\n")); | |
10 } | |
11 | |
12 function draw() | |
13 { | |
14 var canvas = document.getElementById("canvas"); | |
15 var ctx = canvas.getContext("2d"); | |
16 ctx.drawImage(document.getElementById("img"), 0, 0); | |
17 | |
18 try { | |
19 var data = ctx.getImageData(20, 20, 290, 75); | |
20 log("FAIL: getImageData succeeded. Canvas not tainted."); | |
21 } catch (e) { | |
22 log("PASS: getImageData failed. Canvas tainted."); | |
23 } | |
24 } | |
25 </script> | |
26 </head> | |
27 <body> | |
28 <p>This tests that drawing a SVG image to a canvas taints the canvas</p> | |
29 <pre id="console"></pre> | |
30 <canvas id="canvas" width="330" height="115"></canvas> | |
31 <img id="img" onload="draw()" src="resources/image-wrapper.svg"> | |
32 </body> | |
33 </html> | |
OLD | NEW |