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

Side by Side Diff: LayoutTests/svg/as-image/svg-canvas-link-not-colored.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 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <script>
8 if (window.testRunner) {
9 testRunner.dumpAsText();
10 testRunner.waitUntilDone();
11 }
12
13 var svg = new Image();
14 svg.src = "resources/link.svg";
15
16 svg.onload = function() {
17 var canvas = document.createElement("canvas");
18 var ctx = canvas.getContext("2d");
19
20 window.colorChannels = ctx.getImageData(0, 0, 1, 1).data;
21
22 shouldBe("window.colorChannels[0]", "0");
23 shouldBe("window.colorChannels[1]", "0");
24 shouldBe("window.colorChannels[2]", "0");
25
26 ctx.drawImage(svg, 0, 0);
27
28 window.colorChannels = ctx.getImageData(0, 0, 1, 1).data;
29
30 shouldBe("window.colorChannels[0]", "0");
31 shouldBe("window.colorChannels[1]", "128");
32 shouldBe("window.colorChannels[2]", "0");
33
34 if (window.testRunner)
35 testRunner.notifyDone();
36 };
37 </script>
38 </body>
39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698