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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/svg/as-image/svg-canvas-link-not-colored.html
diff --git a/LayoutTests/svg/as-image/svg-canvas-link-not-colored.html b/LayoutTests/svg/as-image/svg-canvas-link-not-colored.html
new file mode 100644
index 0000000000000000000000000000000000000000..53c22d938b125d2dcca2621e35ff0052ed7eda71
--- /dev/null
+++ b/LayoutTests/svg/as-image/svg-canvas-link-not-colored.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ var svg = new Image();
+ svg.src = "resources/link.svg";
+
+ svg.onload = function() {
+ var canvas = document.createElement("canvas");
+ var ctx = canvas.getContext("2d");
+
+ window.colorChannels = ctx.getImageData(0, 0, 1, 1).data;
+
+ shouldBe("window.colorChannels[0]", "0");
+ shouldBe("window.colorChannels[1]", "0");
+ shouldBe("window.colorChannels[2]", "0");
+
+ ctx.drawImage(svg, 0, 0);
+
+ window.colorChannels = ctx.getImageData(0, 0, 1, 1).data;
+
+ shouldBe("window.colorChannels[0]", "0");
+ shouldBe("window.colorChannels[1]", "128");
+ shouldBe("window.colorChannels[2]", "0");
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ };
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698