| <!DOCTYPE html> |
| <title>Check Borkedness of canvas fill rect with zero size</title> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| |
| <canvas width="100" height="100"></canvas> |
| <script> |
| /* |
| Creates a canvas which is filled red, then attempts to |
| fill a number of 0 size rects, finally fills with green. |
| |
| Fill of a 0-sized rect should not throw an exception, so |
| we expected the output to be a green rect. |
| */ |
| async_test(function(t) { |
| window.onload = t.step_func_done(function() { |
| var canvas = document.querySelector('canvas'); |
| var context = canvas.getContext("2d"); |
| context.fillStyle = '#f00'; |
| context.fillRect(0, 0, canvas.width, canvas.height); |
| context.fillRect(0, 0, 0, 0); |
| context.fillRect(0, 0, canvas.width, 0); |
| context.fillRect(0, 0, 0, canvas.height); |
| context.fillStyle = '#0f0'; |
| context.fillRect(0, 0, canvas.width, canvas.height); |
| }); |
| }); |
| </script> |