Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: LayoutTests/canvas/image-with-foreignobject-taint-canvas-2.html

Issue 163573003: Require the entire document-tree of an SVGImage to be single-origin (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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-image-with-foreignobject.svg'); 14 image.setAttribute('src', 'resources/svg-with-multiple-images-one-with-foreign object.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 image with a foreignObject sho uld taint the canvas.<br/> 38 Test for crbug.com/279445: An SVG image with an image with a foreignObject sho uld 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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698