| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 This test passes if there are two green boxes and no crash. | 4 This test passes if there is a green box and no security errors.<br/> |
| 5 <div style="width: 100px; height: 100px; background: url(resources/100px-gre
en-rect.svg);"></div> | |
| 6 <br/> | |
| 7 <canvas id="canvas" width="100" height="100"></canvas> | 5 <canvas id="canvas" width="100" height="100"></canvas> |
| 8 <script> | 6 <script> |
| 9 if (window.testRunner) { | 7 if (window.testRunner) { |
| 10 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
| 11 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
| 12 } | 10 } |
| 13 | 11 |
| 14 var svg = new Image(); | 12 var svg = new Image(); |
| 15 svg.src = 'resources/100px-green-rect.svg'; | 13 svg.src = "resources/100px-green-rect.svg"; |
| 16 | 14 |
| 17 svg.onload = function() { | 15 svg.onload = function() { |
| 18 var canvas = document.getElementById('canvas'); | 16 var canvas = document.getElementById("canvas"); |
| 19 canvas.getContext('2d').drawImage(svg, 0, 0); | 17 var ctx = canvas.getContext("2d"); |
| 18 |
| 19 ctx.drawImage(svg, 0, 0); |
| 20 ctx.getImageData(0, 0, 100, 100); |
| 20 | 21 |
| 21 if (window.testRunner) | 22 if (window.testRunner) |
| 22 testRunner.notifyDone(); | 23 testRunner.notifyDone(); |
| 23 }; | 24 }; |
| 24 </script> | 25 </script> |
| 25 </body> | 26 </body> |
| 26 </html> | 27 </html> |
| OLD | NEW |