| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <script src="/resources/testharness.js"></script> |
| 3 <script src="/resources/testharnessreport.js"></script> |
| 4 <body></body> |
| 5 <script> |
| 6 |
| 7 async_test(function(t) { |
| 8 var canvas = document.createElement("canvas"); |
| 9 canvas.width = canvas.height = 100; |
| 10 |
| 11 var svg = document.createElementNS('http://www.w3.org/2000/svg','svg'); |
| 12 var image = document.createElementNS("http://www.w3.org/2000/svg", "image"); |
| 13 svg.appendChild(image); |
| 14 image.setAttribute('href', |
| 15 'http://localhost:8000/security/resources/red200x100.png'); |
| 16 |
| 17 var ctx = canvas.getContext("2d"); |
| 18 |
| 19 image.addEventListener('load', t.step_func_done(function() { |
| 20 ctx.drawImage(image, 0, 0); |
| 21 |
| 22 assert_throws("SecurityError", function() { |
| 23 var c = ctx.getImageData(0, 0, 1, 1); |
| 24 }, "We are trying cross-origin getImageData"); |
| 25 })); |
| 26 |
| 27 document.body.appendChild(canvas); |
| 28 document.body.appendChild(svg); |
| 29 }, "Checks no cross-origin on tainted canvas due to SVG image"); |
| 30 |
| 31 </script> |
| OLD | NEW |