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

Side by Side Diff: LayoutTests/fast/canvas/svg-taint.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 testRunner.waitUntilDone();
7 }
8
9 function log(message) {
10 var console = document.getElementById('log');
11 console.appendChild(document.createTextNode(message));
12 console.appendChild(document.createElement('br'));
13 }
14
15 function loaded() {
16 var canvas = document.getElementById('canvas');
17 var ctx = canvas.getContext("2d");
18 var img = document.getElementById('img');
19 log('Starting...');
20
21 // This should taint the canvas by rendering an SVG on to it via the pattern
22 // route.
23 var p = ctx.createPattern(img, 'repeat');
24 ctx.fillStyle = p;
25 ctx.fillRect(0, 0, 100, 100);
26
27 try {
28 // This should fail as the canvas should be tainted.
29 var data = ctx.getImageData(0, 0, 10, 10);
30 log('Oh dear -- missing exception!');
31 } catch (e) {
32 log('Exception: ' + e.name);
33 if (window.testRunner)
34 testRunner.notifyDone();
35 }
36 }
37 </script>
38 </head>
39 <body>
40 Let's check that rendering an SVG pattern to a canvas taints it!
41 <p>
42 See https://bugs.webkit.org/show_bug.cgi?id=36838
43 <div id="log"></div>
44 <canvas id="canvas" width="100" height="100"></canvas>
45 <img id="img" onload="loaded()" src="resources/empty.svg"></img>
46 </body>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/http/tests/security/canvas-remote-read-data-url-svg-image.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698