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

Side by Side Diff: LayoutTests/http/tests/security/canvas-remote-read-data-url-svg-image.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
(Empty)
1 <html>
2 <head>
3 <script>
4 if (window.testRunner)
5 testRunner.dumpAsText();
6
7 function log(msg)
8 {
9 document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
10 }
11
12 function draw()
13 {
14 var canvas = document.getElementById("canvas");
15 var ctx = canvas.getContext("2d");
16 ctx.drawImage(document.getElementById("img"), 0, 0);
17
18 try {
19 var data = ctx.getImageData(20, 20, 290, 75);
20 log("FAIL: getImageData succeeded. Canvas not tainted.");
21 } catch (e) {
22 log("PASS: getImageData failed. Canvas tainted.");
23 }
24 }
25 </script>
26 </head>
27 <body>
28 <p>This tests that drawing a remote SVG image onto a canvas from a data URL
29 taints the canvas</p>
30 <pre id="console"></pre>
31 <canvas id="canvas" width="330" height="115"></canvas>
32 <img id="img" onload="draw()" src='data:image/svg+xml,
33 <svg xmlns="http://www.w3.org/2000/svg"
34 xmlns:xlink="http://www.w3.org/1999/xlink"
35 width="100" height="100">
36 <image xlink:href="http://localhost:8000/security/resources/abe.png"
37 width="100" height="100"/>
38 </svg>'>
39 </body>
40 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/canvas/svg-taint.html ('k') | LayoutTests/http/tests/security/canvas-remote-read-svg-image.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698