tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_2d.isPointInPath.winding.html (698B)


      1 <!DOCTYPE HTML>
      2 <title>Canvas test: 2d.isPointInPath.winding</title>
      3 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      4 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
      5 <body>
      6 <canvas id="c" width="100" height="100"><p class="fallback">FAIL (fallback content)</p></canvas>
      7 <script>
      8 SimpleTest.waitForExplicitFinish();
      9 addLoadEvent(function () {
     10 
     11 var canvas = document.getElementById('c');
     12 var ctx = canvas.getContext('2d');
     13 
     14 ctx.beginPath();
     15 ctx.rect(0, 0, 100, 100);
     16 ctx.rect(25, 25, 50, 50);
     17 ok(ctx.isPointInPath(50, 50));
     18 
     19 ctx.beginPath();
     20 ctx.rect(0, 0, 100, 100);
     21 ctx.rect(25, 25, 50, 50);
     22 ok(ctx.isPointInPath(50, 50, 'evenodd') == false);
     23 
     24 SimpleTest.finish();
     25 
     26 });
     27 </script>