1 description("Series of tests to ensure that fill() paints nothing on canvas when the fillStyle is set to a zero-size gradient.");
2 var ctx = document.createElement('canvas').getContext('2d');
4 ctx.fillStyle = '#0f0';
5 ctx.fillRect(0, 0, 1, 1);
7 var g = ctx.createLinearGradient(0, 0, 0, 0); // zero-length line (undefined direction);
8 g.addColorStop(0, '#f00');
9 g.addColorStop(1, '#f00');
14 var imageData = ctx.getImageData(0, 0, 1, 1);
15 var imgdata = imageData.data;
16 shouldBe("imgdata[0]", "0");
17 shouldBe("imgdata[1]", "255");
18 shouldBe("imgdata[2]", "0");