3 <script type=
"text/javascript">
4 function assert(cond
, msg
) { if (!cond
) { throw msg
; } }
5 window
.onload = function() {
7 var ctx
= document
.getElementById("c1").getContext("2d");
9 assert("nonzero" == ctx
.mozFillRule
,
10 "Default fillRule is 'nonzero'");
12 ctx
.mozFillRule
= "evenodd";
13 assert("evenodd" == ctx
.mozFillRule
,
14 "fillRule understands 'evenodd'");
15 ctx
.mozFillRule
= "nonzero";
17 ctx
.mozFillRule
= "garbageLSKJDF 29879234";
18 assert("nonzero" == ctx
.mozFillRule
,
19 "Garbage fillRule string has no effect");
21 ctx
.mozFillRule
= "evenodd";
22 ctx
.mozFillRule
= "garbageLSKJDF 29879234";
23 assert("evenodd" == ctx
.mozFillRule
,
24 "Garbage fillRule string has no effect");
25 ctx
.mozFillRule
= "nonzero";
28 ctx
.mozFillRule
= "evenodd";
30 assert("nonzero" == ctx
.mozFillRule
,
31 "fillRule was saved then restored");
33 document
.body
.innerHTML
= "FAIL: "+ e
.toString();
36 document
.body
.innerHTML
= "Pass";
41 <div><canvas id=
"c1" width=
"300" height=
"300"></canvas></div>