| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Creates a canvas which is filled red, then attempts to | 2 Creates a canvas which is filled red, then attempts to |
| 3 fill a number of 0 size rects, finally fills with green. | 3 fill a number of 0 size rects, finally fills with green. |
| 4 | 4 |
| 5 Fill of a 0-sized rect should not throw an exception, so | 5 Fill of a 0-sized rect should not throw an exception, so |
| 6 we expected the output to be a green rect. | 6 we expected the output to be a green rect. |
| 7 --> | 7 --> |
| 8 <html> | 8 <html> |
| 9 <head> | 9 <head> |
| 10 <script type="text/javascript"> | 10 <script type="text/javascript"> |
| 11 window.onload = function() { | 11 window.onload = function() { |
| 12 if (window.testRunner) | 12 if (window.testRunner) |
| 13 » testRunner.dumpAsText(true); | 13 » testRunner.dumpAsTextWithPixelResults(); |
| 14 | 14 |
| 15 var canvas = document.getElementById("test"); | 15 var canvas = document.getElementById("test"); |
| 16 var context = canvas.getContext("2d"); | 16 var context = canvas.getContext("2d"); |
| 17 context.fillStyle = '#f00'; | 17 context.fillStyle = '#f00'; |
| 18 context.fillRect(0, 0, canvas.width, canvas.height); | 18 context.fillRect(0, 0, canvas.width, canvas.height); |
| 19 try { | 19 try { |
| 20 context.fillRect(0, 0, 0, 0); | 20 context.fillRect(0, 0, 0, 0); |
| 21 context.fillRect(0, 0, canvas.width, 0); | 21 context.fillRect(0, 0, canvas.width, 0); |
| 22 context.fillRect(0, 0, 0, canvas.height); | 22 context.fillRect(0, 0, 0, canvas.height); |
| 23 } catch (e) { | 23 } catch (e) { |
| 24 var node = document.createTextNode("FAIL -- an exception was thrown when
drawing a 0 sized rect"); | 24 var node = document.createTextNode("FAIL -- an exception was thrown when
drawing a 0 sized rect"); |
| 25 document.getElementById("body").appendChild(node); | 25 document.getElementById("body").appendChild(node); |
| 26 return; | 26 return; |
| 27 } | 27 } |
| 28 context.fillStyle = '#0f0'; | 28 context.fillStyle = '#0f0'; |
| 29 context.fillRect(0, 0, canvas.width, canvas.height); | 29 context.fillRect(0, 0, canvas.width, canvas.height); |
| 30 var node = document.createTextNode("PASS -- 0 sized rects did not trigger an
exception"); | 30 var node = document.createTextNode("PASS -- 0 sized rects did not trigger an
exception"); |
| 31 document.getElementById("body").appendChild(node); | 31 document.getElementById("body").appendChild(node); |
| 32 } | 32 } |
| 33 </script> | 33 </script> |
| 34 <title>borkedness</title> | 34 <title>borkedness</title> |
| 35 </head> | 35 </head> |
| 36 <body id="body"> | 36 <body id="body"> |
| 37 <canvas id="test" width="100" height="100"></canvas> | 37 <canvas id="test" width="100" height="100"></canvas> |
| 38 <br> | 38 <br> |
| 39 </body> | 39 </body> |
| 40 </html> | 40 </html> |
| OLD | NEW |