4 if (window.layoutTestController) {
5 layoutTestController.dumpAsText();
6 layoutTestController.waitUntilDone();
9 function log(message) {
10 var console = document.getElementById('log');
11 console.appendChild(document.createTextNode(message));
12 console.appendChild(document.createElement('br'));
16 var canvas = document.getElementById('canvas');
17 var ctx = canvas.getContext("2d");
18 var img = document.getElementById('img');
21 // This should taint the canvas by rendering an SVG on to it via the pattern
23 var p = ctx.createPattern(img, 'repeat');
25 ctx.fillRect(0, 0, 100, 100);
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!');
32 log('Exception: ' + e.name);
33 if (window.layoutTestController)
34 layoutTestController.notifyDone();
40 Let's check that rendering an SVG pattern to a canvas taints it!
42 See https://bugs.webkit.org/show_bug.cgi?id=36838
44 <canvas id="canvas" width="100" height="100"></canvas>
45 <img id="img" onload="loaded()" src="resources/empty.svg"></img>