gecko-dev/content/canvas/test/test_2d.state.saverestore.underflow.html

28 lines
751 B
HTML

<!DOCTYPE HTML>
<title>Canvas test: 2d.state.saverestore.underflow - bug 296821</title>
<!-- Testing: restore() with an empty stack has no effect -->
<script src="/MochiKit/MochiKit.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');
for (var i = 0; i < 16; ++i)
ctx.restore();
ctx.lineWidth = 0.5;
ctx.restore();
ok(ctx.lineWidth == 0.5, "ctx.lineWidth == 0.5");
SimpleTest.finish();
});
</script>