pjs/content/canvas/test/test_2d.shadow.attributes.s...

38 строки
1.2 KiB
HTML

<!DOCTYPE HTML>
<title>Canvas test: 2d.shadow.attributes.shadowOffset.1</title>
<script src="/MochiKit/packed.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<body>
<canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script>
SimpleTest.waitForExplicitFinish();
MochiKit.DOM.addLoadEvent(function () {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ok(ctx.shadowOffsetX === 1, "ctx.shadowOffsetX === 1");
ok(ctx.shadowOffsetY === 2, "ctx.shadowOffsetY === 2");
ctx.shadowOffsetX = 0.5;
ctx.shadowOffsetY = 0.25;
ok(ctx.shadowOffsetX === 0.5, "ctx.shadowOffsetX === 0.5");
ok(ctx.shadowOffsetY === 0.25, "ctx.shadowOffsetY === 0.25");
ctx.shadowOffsetX = -0.5;
ctx.shadowOffsetY = -0.25;
ok(ctx.shadowOffsetX === -0.5, "ctx.shadowOffsetX === -0.5");
ok(ctx.shadowOffsetY === -0.25, "ctx.shadowOffsetY === -0.25");
ctx.shadowOffsetX = 1e6;
ctx.shadowOffsetY = 1e6;
ok(ctx.shadowOffsetX === 1e6, "ctx.shadowOffsetX === 1e6");
ok(ctx.shadowOffsetY === 1e6, "ctx.shadowOffsetY === 1e6");
SimpleTest.finish();
});
</script>