blob: 8fd6f65d311466db044d1162163c404033795773 [file] [log] [blame]
<!DOCTYPE html>
<title>Canvas test: 2d.path.isPointInPath.outside</title>
<script src="../tests.js"></script>
<link rel="stylesheet" href="../tests.css">
<body>
<p id="passtext">Pass</p>
<p id="failtext">Fail</p>
<p class="output">These images should be identical:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<ul id="d"></ul>
<script>
_addTest(function(canvas, ctx) {
ctx.rect(0, -100, 20, 20);
ctx.rect(20, -10, 20, 20);
_assertSame(ctx.isPointInPath(10, -110), false, "ctx.isPointInPath(10, -110)", "false");
_assertSame(ctx.isPointInPath(10, -90), true, "ctx.isPointInPath(10, -90)", "true");
_assertSame(ctx.isPointInPath(10, -70), false, "ctx.isPointInPath(10, -70)", "false");
_assertSame(ctx.isPointInPath(30, -20), false, "ctx.isPointInPath(30, -20)", "false");
_assertSame(ctx.isPointInPath(30, 0), true, "ctx.isPointInPath(30, 0)", "true");
_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false");
});
</script>