layout/reftests/canvas/evenodd-fill-sanity.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <html>
     2 <head>
     3   <script type="text/javascript">
     4 function assert(cond, msg) { if (!cond) { throw msg; } }
     5 window.onload = function() {
     6     try {
     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";
    27         ctx.save();
    28         ctx.mozFillRule = "evenodd";
    29         ctx.restore();
    30         assert("nonzero" == ctx.mozFillRule,
    31                "fillRule was saved then restored");
    32     } catch (e) {
    33         document.body.innerHTML = "FAIL: "+ e.toString();
    34         return;
    35     }
    36     document.body.innerHTML = "Pass";
    37 }
    38   </script>
    39 </head>
    40 <body>
    41   <div><canvas id="c1" width="300" height="300"></canvas></div>
    42 </body>
    43 </html>

mercurial