Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / canvas / image-with-foreignobject-taint-canvas-2.html
1 <!DOCTYPE HTML>
2 <html>
3 <script>
4 var canvas, context, pattern, image;
5
6 function runTest() {
7   if (window.testRunner)
8     testRunner.waitUntilDone();
9
10   canvas = document.getElementById('canvas');
11   context = canvas.getContext('2d');
12
13   image = document.createElement('img');
14   image.setAttribute('src', 'resources/svg-with-multiple-images-one-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');
25     }
26   }
27 }
28
29 function finishTest(output) {
30   document.write(output);
31   if (window.testRunner) {
32     testRunner.dumpAsText();
33     testRunner.notifyDone();
34   }
35 }
36 </script>
37 <body onload='runTest()'>
38   Test for crbug.com/279445: An SVG image with an image 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>