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) | 10 if (window.testRunner) |
11 testRunner.dumpAsText(true); | 11 testRunner.dumpAsTextWithPixelResults(); |
12 | 12 |
13 var canvas = document.getElementsByTagName('canvas')[0]; | 13 var canvas = document.getElementsByTagName('canvas')[0]; |
14 var context = canvas.getContext('2d'); | 14 var context = canvas.getContext('2d'); |
15 | 15 |
16 // This should get nuked by the resize below | 16 // This should get nuked by the resize below |
17 context.fillStyle = 'red'; | 17 context.fillStyle = 'red'; |
18 context.fillRect(0, 0, 200, 100); | 18 context.fillRect(0, 0, 200, 100); |
19 | 19 |
20 // THE TEST | 20 // THE TEST |
21 context.fillStyle = 'red'; | 21 context.fillStyle = 'red'; |
22 context.strokeStyle = 'red'; | 22 context.strokeStyle = 'red'; |
23 context.lineWidth = 25; | 23 context.lineWidth = 25; |
24 context.beginPath(); | 24 context.beginPath(); |
25 context.moveTo(25, 25); | 25 context.moveTo(25, 25); |
26 context.moveTo(125, 25); | 26 context.moveTo(125, 25); |
27 context.moveTo(125, 125); | 27 context.moveTo(125, 125); |
28 context.moveTo(25, 125); | 28 context.moveTo(25, 125); |
29 canvas.setAttribute('height', '200'); // this should wipe the red away and bl
ow away all the other state | 29 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 | 30 context.fill(); // so this should do nothing |
31 context.strokeRect(0, 201, 200, 201); // this should draw nothing | 31 context.strokeRect(0, 201, 200, 201); // this should draw nothing |
32 </script> | 32 </script> |
33 </body> | 33 </body> |
34 </html> | 34 </html> |
OLD | NEW |