2 <title>Canvas test:
2d.path.isPointInPath.edge
</title>
3 <!-- Testing: isPointInPath() counts points on the path as being inside -->
4 <script src=
"/MochiKit/MochiKit.js"></script>
5 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
8 <canvas id=
"c" width=
"100" height=
"50"><p class=
"fallback">FAIL (fallback content)
</p></canvas>
11 SimpleTest
.waitForExplicitFinish();
12 MochiKit
.DOM
.addLoadEvent(function () {
14 var canvas
= document
.getElementById('c');
15 var ctx
= canvas
.getContext('2d');
17 ctx
.rect(0, 0, 20, 20);
18 todo(ctx
.isPointInPath(0, 0) === true, "ctx.isPointInPath(0, 0) === true");
19 ok(ctx
.isPointInPath(10, 0) === true, "ctx.isPointInPath(10, 0) === true");
20 ok(ctx
.isPointInPath(20, 0) === true, "ctx.isPointInPath(20, 0) === true");
21 ok(ctx
.isPointInPath(20, 10) === true, "ctx.isPointInPath(20, 10) === true");
22 ok(ctx
.isPointInPath(20, 20) === true, "ctx.isPointInPath(20, 20) === true");
23 ok(ctx
.isPointInPath(10, 20) === true, "ctx.isPointInPath(10, 20) === true");
24 ok(ctx
.isPointInPath(0, 20) === true, "ctx.isPointInPath(0, 20) === true");
25 ok(ctx
.isPointInPath(0, 10) === true, "ctx.isPointInPath(0, 10) === true");
26 ok(ctx
.isPointInPath(10, -0.01) === false, "ctx.isPointInPath(10, -0.01) === false");
27 ok(ctx
.isPointInPath(10, 20.01) === false, "ctx.isPointInPath(10, 20.01) === false");
28 ok(ctx
.isPointInPath(-0.01, 10) === false, "ctx.isPointInPath(-0.01, 10) === false");
29 ok(ctx
.isPointInPath(20.01, 10) === false, "ctx.isPointInPath(20.01, 10) === false");