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 <!DOCTYPE html> | |
8 <html> | 9 <html> |
sivag
2016/09/06 12:58:44
remove html, head not needed.
Abhishek Kanike
2016/09/08 09:05:07
Done.
| |
9 <head> | 10 <head> |
11 <title>Check Borkedness of canvas fill rect with zero size</title> | |
12 <script src="../../resources/testharness.js"></script> | |
13 <script src="../../resources/testharnessreport.js"></script> | |
14 | |
10 <script type="text/javascript"> | 15 <script type="text/javascript"> |
Srirama
2016/09/06 13:27:20
remove type attribute.
Abhishek Kanike
2016/09/08 09:05:07
Done.
| |
11 window.onload = function() { | 16 async_test(function(t) { |
12 if (window.testRunner) | 17 window.onload = t.step_func_done(function() { |
13 testRunner.dumpAsText(); | 18 var canvas = document.getElementById("test"); |
sivag
2016/09/06 12:58:44
document.queryselector('canvas')
Abhishek Kanike
2016/09/08 09:05:07
Done.
| |
14 var canvas = document.getElementById("test"); | 19 var context = canvas.getContext("2d"); |
15 var context = canvas.getContext("2d"); | 20 context.fillStyle = '#f00'; |
16 context.fillStyle = '#f00'; | 21 context.fillRect(0, 0, canvas.width, canvas.height); |
17 context.fillRect(0, 0, canvas.width, canvas.height); | |
18 try { | |
19 context.fillRect(0, 0, 0, 0); | 22 context.fillRect(0, 0, 0, 0); |
20 context.fillRect(0, 0, canvas.width, 0); | 23 context.fillRect(0, 0, canvas.width, 0); |
21 context.fillRect(0, 0, 0, canvas.height); | 24 context.fillRect(0, 0, 0, canvas.height); |
22 } catch (e) { | 25 context.fillStyle = '#0f0'; |
23 var node = document.createTextNode("FAIL -- an exception was thrown when drawing a 0 sized rect"); | 26 context.fillRect(0, 0, canvas.width, canvas.height); |
24 document.getElementById("body").appendChild(node); | 27 }); |
25 return; | 28 }); |
26 } | |
27 context.fillStyle = '#0f0'; | |
28 context.fillRect(0, 0, canvas.width, canvas.height); | |
29 var node = document.createTextNode("PASS -- 0 sized rects did not trigger an exception"); | |
30 document.getElementById("body").appendChild(node); | |
31 } | |
32 </script> | 29 </script> |
33 <title>borkedness</title> | |
34 </head> | 30 </head> |
sivag
2016/09/06 12:58:44
remove head, body, br, html tags.
move canvas tag
Abhishek Kanike
2016/09/08 09:05:08
Done.
| |
35 <body id="body"> | 31 <body id="body"> |
36 <canvas id="test" width="100" height="100"></canvas> | 32 <canvas id="test" width="100" height="100"></canvas> |
37 <br> | 33 <br> |
38 </body> | 34 </body> |
39 </html> | 35 </html> |
OLD | NEW |