1 test = function(setter) {
2 document.body.appendChild(document.createElement("p")).appendChild(document.createTextNode("There should be no red pixels below."));
3 var canvas = document.body.appendChild(document.createElement("canvas"));
6 canvas.style.backgroundColor = "white";
7 var ctx = canvas.getContext('2d');
12 for (var offsetY = -10; offsetY <= 10; offsetY++) {
14 for (var offsetX = -10; offsetX <= 10; offsetX++) {
15 ctx.shadowOffsetX = 0;
18 ctx.shadowColor = "transparent";
20 ctx.fillStyle = 'red';
21 ctx.fillRect(x + offsetX, y + offsetY, w, h);
23 setter(ctx, offsetX, offsetY);
25 ctx.fillStyle = 'white';
26 ctx.fillRect(x, y, w, h);
28 x += w + Math.abs(offsetX) + 2;
30 y += h + Math.abs(offsetY) + 2;