| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <script> | 3 <script> |
| 4 var canvas, context, pattern, image; | 4 var canvas, context, pattern, image; |
| 5 | 5 |
| 6 function runTest() { | 6 function runTest() { |
| 7 if (window.testRunner) | 7 if (window.testRunner) |
| 8 testRunner.waitUntilDone(); | 8 testRunner.waitUntilDone(); |
| 9 | 9 |
| 10 canvas = document.getElementById('canvas'); | 10 canvas = document.getElementById('canvas'); |
| 11 context = canvas.getContext('2d'); | 11 context = canvas.getContext('2d'); |
| 12 | 12 |
| 13 image = document.createElement('img'); | 13 image = document.createElement('img'); |
| 14 image.setAttribute('src', 'resources/svg-with-feimage-with-foreignobject.svg')
; | 14 image.setAttribute('src', 'resources/svg-with-multiple-feimage-one-with-foreig
nobject.svg'); |
| 15 image.onload = function() { | 15 image.onload = function() { |
| 16 pattern = context.createPattern(image, 'repeat'); | 16 pattern = context.createPattern(image, 'repeat'); |
| 17 context.fillStyle = pattern; | 17 context.fillStyle = pattern; |
| 18 context.fillRect(0, 0, 100, 100); | 18 context.fillRect(0, 0, 100, 100); |
| 19 try { | 19 try { |
| 20 // This should throw an exception. | 20 // This should throw an exception. |
| 21 var pixels = context.getImageData(0, 0, 1, 1).data; | 21 var pixels = context.getImageData(0, 0, 1, 1).data; |
| 22 finishTest('FAIL - svg with feImage with foreignObject did not taint the c
anvas.'); | 22 finishTest('FAIL - svg with feImage with foreignObject did not taint the c
anvas.'); |
| 23 } catch (e) { | 23 } catch (e) { |
| 24 finishTest('PASS'); | 24 finishTest('PASS'); |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 } | 27 } |
| 28 | 28 |
| 29 function finishTest(output) { | 29 function finishTest(output) { |
| 30 document.write(output); | 30 document.write(output); |
| 31 if (window.testRunner) { | 31 if (window.testRunner) { |
| 32 testRunner.dumpAsText(); | 32 testRunner.dumpAsText(); |
| 33 testRunner.notifyDone(); | 33 testRunner.notifyDone(); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 </script> | 36 </script> |
| 37 <body onload='runTest()'> | 37 <body onload='runTest()'> |
| 38 Test for crbug.com/279445: An SVG image with an feImage with a foreignObject s
hould taint the canvas.<br/> | 38 Test for crbug.com/279445: An SVG image with an feImage with a foreignObject s
hould taint the canvas.<br/> |
| 39 FAIL - test did not run.<br/> | 39 FAIL - test did not run.<br/> |
| 40 <canvas id='canvas' width='100' height='100'></canvas> | 40 <canvas id='canvas' width='100' height='100'></canvas> |
| 41 </body> | 41 </body> |
| 42 </html> | 42 </html> |
| OLD | NEW |