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

Side by Side Diff: LayoutTests/svg/as-image/svg-canvas-not-tainted.html

Issue 22604008: Allow SVG images to not taint the canvas with drawImage/drawPattern (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase after r156375 Created 7 years, 4 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 <body> 3 <body>
4 This test passes if there are two green boxes and no crash. 4 This test passes if there is a green box and no security errors.<br/>
5 <div style="width: 100px; height: 100px; background: url(resources/100px-gre en-rect.svg);"></div>
6 <br/>
7 <canvas id="canvas" width="100" height="100"></canvas> 5 <canvas id="canvas" width="100" height="100"></canvas>
8 <script> 6 <script>
9 if (window.testRunner) { 7 if (window.testRunner) {
10 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
11 testRunner.waitUntilDone(); 9 testRunner.waitUntilDone();
12 } 10 }
13 11
14 var svg = new Image(); 12 var svg = new Image();
15 svg.src = 'resources/100px-green-rect.svg'; 13 svg.src = "resources/100px-green-rect.svg";
16 14
17 svg.onload = function() { 15 svg.onload = function() {
18 var canvas = document.getElementById('canvas'); 16 var canvas = document.getElementById("canvas");
19 canvas.getContext('2d').drawImage(svg, 0, 0); 17 var ctx = canvas.getContext("2d");
18
19 ctx.drawImage(svg, 0, 0);
20 ctx.getImageData(0, 0, 100, 100);
20 21
21 if (window.testRunner) 22 if (window.testRunner)
22 testRunner.notifyDone(); 23 testRunner.notifyDone();
23 }; 24 };
24 </script> 25 </script>
25 </body> 26 </body>
26 </html> 27 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698