blob: c30d6bc3f6d83643bc0c1ddd3833947c8464bd0a [file] [log] [blame]
<html>
<head>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function log(msg)
{
document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
}
function draw()
{
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
ctx.drawImage(document.getElementById("img"), 0, 0);
try {
var data = ctx.getImageData(20, 20, 290, 75);
log("FAIL: getImageData succeeded. Canvas not tainted.");
} catch (e) {
log("PASS: getImageData failed. Canvas tainted.");
}
}
</script>
</head>
<body>
<p>This tests that drawing a SVG image to a canvas taints the canvas</p>
<pre id="console"></pre>
<canvas id="canvas" width="330" height="115"></canvas>
<img id="img" onload="draw()" src="resources/image-wrapper.svg">
</body>
</html>