mirror of
https://github.com/servo/servo.git
synced 2025-06-23 16:44:33 +01:00
31 lines
1.2 KiB
HTML
31 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
|
<title>OffscreenCanvas test: 2d.path.isPointInPath.transform.1</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/common/canvas-tests.js"></script>
|
|
|
|
<h1>2d.path.isPointInPath.transform.1</h1>
|
|
<p class="desc">isPointInPath() handles transformations correctly</p>
|
|
|
|
|
|
<script>
|
|
var t = async_test("isPointInPath() handles transformations correctly");
|
|
t.step(function() {
|
|
|
|
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
|
var ctx = offscreenCanvas.getContext('2d');
|
|
|
|
ctx.translate(50, 0);
|
|
ctx.rect(0, 0, 20, 20);
|
|
_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false");
|
|
_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
|
|
_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false");
|
|
_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true");
|
|
_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true");
|
|
_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false");
|
|
|
|
t.done();
|
|
|
|
});
|
|
</script>
|