OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <script src="../../resources/testharness.js"></script> |
2 <html> | 2 <script src="../../resources/testharnessreport.js"></script> |
3 <head> | |
4 <script src="../../resources/js-test.js"></script> | |
5 </head> | |
6 <body> | 3 <body> |
7 <script src="script-tests/canvas-strokeText-zeroSizeGradient.js"></script> | 4 <script> |
| 5 test(function(t) { |
| 6 var ctx = document.createElement('canvas').getContext('2d'); |
| 7 |
| 8 ctx.fillStyle = '#0f0'; |
| 9 ctx.fillRect(0, 0, 1, 1); |
| 10 |
| 11 var g = ctx.createLinearGradient(0, 0, 0, 0); // zero-length line (undefined
direction); |
| 12 g.addColorStop(0, '#f00'); |
| 13 g.addColorStop(1, '#f00'); |
| 14 ctx.strokeStyle = g; |
| 15 ctx.font = '1px sans-serif'; |
| 16 ctx.strokeText("AA", 0, 1); |
| 17 |
| 18 assert_array_equals(ctx.getImageData(0, 0, 1, 1).data.slice(0,3), [0, 255, 0
]); |
| 19 }, "Series of tests to ensure that strokeText() paints nothing on canvas when th
e strokeStyle is set to a zero-size gradient."); |
| 20 </script> |
8 </body> | 21 </body> |
9 </html> | |
OLD | NEW |