2 Creates a canvas which is filled red, then attempts to
3 fill a number of 0 size rects, finally fills with green.
5 Fill of a 0-sized rect should not throw an exception, so
6 we expected the output to be a green rect.
10 <script type=
"text/javascript">
11 window
.onload = function() {
12 if (window
.testRunner
)
13 testRunner
.dumpAsText();
14 var canvas
= document
.getElementById("test");
15 var context
= canvas
.getContext("2d");
16 context
.fillStyle
= '#f00';
17 context
.fillRect(0, 0, canvas
.width
, canvas
.height
);
19 context
.fillRect(0, 0, 0, 0);
20 context
.fillRect(0, 0, canvas
.width
, 0);
21 context
.fillRect(0, 0, 0, canvas
.height
);
23 var node
= document
.createTextNode("FAIL -- an exception was thrown when drawing a 0 sized rect");
24 document
.getElementById("body").appendChild(node
);
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
);
33 <title>borkedness
</title>
36 <canvas id=
"test" width=
"100" height=
"100"></canvas>