forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_mozDashOffset.html
39 lines (35 loc) · 1021 Bytes
/
test_mozDashOffset.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE HTML>
<html>
<head>
<title>Test for mozDashOffset</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p id="display">
<canvas id="c" width="100" height="100"><p class="fallback">FAIL (fallback content)</p></canvas>
</p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script>
try {
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.mozDash = [1, 1];
ctx.mozDashOffset = 1;
ctx.mozDashOffset = Infinity;
ok(ctx.mozDashOffset === 1, "ctx.mozDashOffset === 1");
ctx.mozDashOffset = 1;
ctx.mozDashOffset = -Infinity;
ok(ctx.mozDashOffset === 1, "ctx.mozDashOffset === 1");
ctx.mozDashOffset = 1;
ctx.mozDashOffset = NaN;
ok(ctx.mozDashOffset === 1, "ctx.mozDashOffset === 1");
} catch(e) {
ok(false, "unexpected exception thrown in: test_mozDashOffset.html");
}
</script>
</pre>
</body>
</html>