OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <canvas id='c'></canvas> |
| 3 |
| 4 <script> |
| 5 const canvas = document.getElementById('c'), |
| 6 ctx = c.getContext('2d', {alpha: false}); |
| 7 |
| 8 // The following would permanently damage the canvas (crbug.com/532148) |
| 9 canvas.height = null; |
| 10 ctx.fillRect( 0, 0, 128, null ); |
| 11 |
| 12 // Try to use canvas normally |
| 13 canvas.width = 128; |
| 14 canvas.height = 128; |
| 15 |
| 16 ctx.fillStyle = 'green'; |
| 17 ctx.fillRect( 0, 0, 128, 128 ); |
| 18 ctx.fillStyle = 'blue'; |
| 19 ctx.fillRect( 0, 0, 64, 64 ); |
| 20 ctx.fillRect( 64, 64, 64, 64 ); |
| 21 </script> |
OLD | NEW |