Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / canvas / feimage-with-foreignobject-taint-canvas.html
blobbcee2f65371d0fe65c6c462d18ee002817da8463
1 <!DOCTYPE HTML>
2 <html>
3 <script>
4 var canvas, context, pattern, image;
6 function runTest() {
7 if (window.testRunner)
8 testRunner.waitUntilDone();
10 canvas = document.getElementById('canvas');
11 context = canvas.getContext('2d');
13 image = document.createElement('img');
14 image.setAttribute('src', 'resources/svg-with-feimage-with-foreignobject.svg');
15 image.onload = function() {
16 pattern = context.createPattern(image, 'repeat');
17 context.fillStyle = pattern;
18 context.fillRect(0, 0, 100, 100);
19 try {
20 // This should throw an exception.
21 var pixels = context.getImageData(0, 0, 1, 1).data;
22 finishTest('FAIL - svg with feImage with foreignObject did not taint the canvas.');
23 } catch (e) {
24 finishTest('PASS');
29 function finishTest(output) {
30 document.write(output);
31 if (window.testRunner) {
32 testRunner.dumpAsText();
33 testRunner.notifyDone();
36 </script>
37 <body onload='runTest()'>
38 Test for crbug.com/279445: An SVG image with an feImage with a foreignObject should taint the canvas.<br/>
39 FAIL - test did not run.<br/>
40 <canvas id='canvas' width='100' height='100'></canvas>
41 </body>
42 </html>