Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / canvas / test / test_2d.path.isPointInPath.winding.html
blob55b5321589fabf3d38303a9c1419a2d7bc0685c7
1 <!DOCTYPE HTML>
2 <title>Canvas test: 2d.path.isPointInPath.winding</title>
3 <!-- Testing: isPointInPath() uses the non-zero winding number rule -->
4 <script src="/MochiKit/MochiKit.js"></script>
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
7 <body>
8 <canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
9 <script>
11 SimpleTest.waitForExplicitFinish();
12 MochiKit.DOM.addLoadEvent(function () {
14 var canvas = document.getElementById('c');
15 var ctx = canvas.getContext('2d');
17 // Create a square ring, using opposite windings to make a hole in the centre
18 ctx.moveTo(0, 0);
19 ctx.lineTo(50, 0);
20 ctx.lineTo(50, 50);
21 ctx.lineTo(0, 50);
22 ctx.lineTo(0, 0);
23 ctx.lineTo(10, 10);
24 ctx.lineTo(10, 40);
25 ctx.lineTo(40, 40);
26 ctx.lineTo(40, 10);
27 ctx.lineTo(10, 10);
29 ok(ctx.isPointInPath(5, 5) === true, "ctx.isPointInPath(5, 5) === true");
30 ok(ctx.isPointInPath(25, 5) === true, "ctx.isPointInPath(25, 5) === true");
31 ok(ctx.isPointInPath(45, 5) === true, "ctx.isPointInPath(45, 5) === true");
32 ok(ctx.isPointInPath(5, 25) === true, "ctx.isPointInPath(5, 25) === true");
33 ok(ctx.isPointInPath(25, 25) === false, "ctx.isPointInPath(25, 25) === false");
34 ok(ctx.isPointInPath(45, 25) === true, "ctx.isPointInPath(45, 25) === true");
35 ok(ctx.isPointInPath(5, 45) === true, "ctx.isPointInPath(5, 45) === true");
36 ok(ctx.isPointInPath(25, 45) === true, "ctx.isPointInPath(25, 45) === true");
37 ok(ctx.isPointInPath(45, 45) === true, "ctx.isPointInPath(45, 45) === true");
39 SimpleTest.finish();
41 });
42 </script>