Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<meta charset="UTF-8">
<title>Canvas test: 2d.path.isPointInPath.nobitmap.winding</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/html/canvas/resources/canvas-tests.js"></script>
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
<body class="show_output">
<h1>2d.path.isPointInPath.nobitmap.winding</h1>
<p class="desc">isPointInPath() honours the fill rule on a canvas with no bitmap</p>
<p class="output">Actual output:</p>
<canvas id="c" class="output" width="0" height="0"><p class="fallback">FAIL (fallback content)</p></canvas>
<ul id="d"></ul>
<script>
var t = async_test("isPointInPath() honours the fill rule on a canvas with no bitmap");
_addTest(function(canvas, ctx) {
ctx.rect(0, 0, 40, 40);
ctx.rect(10, 10, 20, 20);
_assertSame(ctx.isPointInPath(20, 20, 'nonzero'), true, "ctx.isPointInPath(20, 20, 'nonzero')", "true");
_assertSame(ctx.isPointInPath(20, 20, 'evenodd'), false, "ctx.isPointInPath(20, 20, 'evenodd')", "false");
_assertSame(ctx.isPointInPath(5, 5, 'nonzero'), true, "ctx.isPointInPath(5, 5, 'nonzero')", "true");
_assertSame(ctx.isPointInPath(5, 5, 'evenodd'), true, "ctx.isPointInPath(5, 5, 'evenodd')", "true");
});
</script>