| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Resizing a canvas</title> | 4 <title>Resizing a canvas</title> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <p>There should be nothing below. Bug 8994. </p> | 7 <p>There should be nothing below. Bug 8994. </p> |
| 8 <p><canvas width="200" height="100">FAIL</canvas></p> | 8 <p><canvas width="200" height="100">FAIL</canvas></p> |
| 9 <script> | 9 <script> |
| 10 if (window.testRunner) | |
| 11 testRunner.dumpAsTextWithPixelResults(); | |
| 12 | |
| 13 var canvas = document.getElementsByTagName('canvas')[0]; | 10 var canvas = document.getElementsByTagName('canvas')[0]; |
| 14 var context = canvas.getContext('2d'); | 11 var context = canvas.getContext('2d'); |
| 15 | 12 |
| 16 // This should get nuked by the resize below | 13 // This should get nuked by the resize below |
| 17 context.fillStyle = 'red'; | 14 context.fillStyle = 'red'; |
| 18 context.fillRect(0, 0, 200, 100); | 15 context.fillRect(0, 0, 200, 100); |
| 19 | 16 |
| 20 // THE TEST | 17 // THE TEST |
| 21 context.fillStyle = 'red'; | 18 context.fillStyle = 'red'; |
| 22 context.strokeStyle = 'red'; | 19 context.strokeStyle = 'red'; |
| 23 context.lineWidth = 25; | 20 context.lineWidth = 25; |
| 24 context.beginPath(); | 21 context.beginPath(); |
| 25 context.moveTo(25, 25); | 22 context.moveTo(25, 25); |
| 26 context.moveTo(125, 25); | 23 context.moveTo(125, 25); |
| 27 context.moveTo(125, 125); | 24 context.moveTo(125, 125); |
| 28 context.moveTo(25, 125); | 25 context.moveTo(25, 125); |
| 29 canvas.setAttribute('height', '200'); // this should wipe the red away and bl
ow away all the other state | 26 canvas.setAttribute('height', '200'); // this should wipe the red away and bl
ow away all the other state |
| 30 context.fill(); // so this should do nothing | 27 context.fill(); // so this should do nothing |
| 31 context.strokeRect(0, 201, 200, 201); // this should draw nothing | 28 context.strokeRect(0, 201, 200, 201); // this should draw nothing |
| 32 </script> | 29 </script> |
| 33 </body> | 30 </body> |
| 34 </html> | 31 </html> |
| OLD | NEW |