| OLD | NEW |
| (Empty) |
| 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'); | |
| 3 | |
| 4 ctx.fillStyle = '#0f0'; | |
| 5 ctx.fillRect(0, 0, 1, 1); | |
| 6 | |
| 7 var g = ctx.createLinearGradient(0, 0, 0, 0); // zero-length line (undefined dir
ection); | |
| 8 g.addColorStop(0, '#f00'); | |
| 9 g.addColorStop(1, '#f00'); | |
| 10 ctx.fillStyle = g; | |
| 11 ctx.rect(0, 0, 1 ,1); | |
| 12 ctx.fill(); | |
| 13 | |
| 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"); | |
| OLD | NEW |