| if (window.layoutTestController) { |
| layoutTestController.dumpAsText(); |
| layoutTestController.waitUntilDone(); |
| var console = document.getElementById('log'); |
| console.appendChild(document.createTextNode(message)); |
| console.appendChild(document.createElement('br')); |
| var canvas = document.getElementById('canvas'); |
| var ctx = canvas.getContext("2d"); |
| var img = document.getElementById('img'); |
| // This should taint the canvas by rendering an SVG on to it via the pattern |
| var p = ctx.createPattern(img, 'repeat'); |
| ctx.fillRect(0, 0, 100, 100); |
| // This should fail as the canvas should be tainted. |
| var data = ctx.getImageData(0, 0, 10, 10); |
| log('Oh dear -- missing exception!'); |
| log('Exception: ' + e.name); |
| if (window.layoutTestController) |
| layoutTestController.notifyDone(); |
| Let's check that rendering an SVG pattern to a canvas taints it! |
| See https://bugs.webkit.org/show_bug.cgi?id=36838 |
| <canvas id="canvas" width="100" height="100"></canvas> |
| <img id="img" onload="loaded()" src="resources/empty.svg"></img> |