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

Unified 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: 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-not-tainted.html
diff --git a/LayoutTests/svg/as-image/svg-canvas-draw-image-detached.html b/LayoutTests/svg/as-image/svg-canvas-not-tainted.html
similarity index 52%
copy from LayoutTests/svg/as-image/svg-canvas-draw-image-detached.html
copy to LayoutTests/svg/as-image/svg-canvas-not-tainted.html
index f57719696707303a3f6bbe860d26e9360da2bf46..054defb185cc285fc75a76bf92697249039d2e2d 100644
--- a/LayoutTests/svg/as-image/svg-canvas-draw-image-detached.html
+++ b/LayoutTests/svg/as-image/svg-canvas-not-tainted.html
@@ -1,9 +1,7 @@
<!DOCTYPE html>
<html>
<body>
- This test passes if there are two green boxes and no crash.
- <div style="width: 100px; height: 100px; background: url(resources/100px-green-rect.svg);"></div>
- <br/>
+ This test passes if there is a green box and no security errors.<br/>
<canvas id="canvas" width="100" height="100"></canvas>
<script>
if (window.testRunner) {
@@ -12,15 +10,18 @@
}
var svg = new Image();
- svg.src = 'resources/100px-green-rect.svg';
+ svg.src = "resources/100px-green-rect.svg";
svg.onload = function() {
- var canvas = document.getElementById('canvas');
- canvas.getContext('2d').drawImage(svg, 0, 0);
+ var canvas = document.getElementById("canvas");
+ var ctx = canvas.getContext("2d");
+
+ ctx.drawImage(svg, 0, 0);
+ ctx.getImageData(0, 0, 100, 100);
if (window.testRunner)
testRunner.notifyDone();
};
</script>
</body>
-</html>
+</html>

Powered by Google App Engine
This is Rietveld 408576698