Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / canvas / test / test_text.textBaseline.html
blob2cd71534bc242de59580272a8e6c29279deadcb2
1 <!DOCTYPE HTML>
2 <title>Canvas test: text.textBaseline</title>
3 <script src="/MochiKit/MochiKit.js"></script>
4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
5 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
6 <body>
7 <canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
8 <script>
9 var _deferred = false;
11 SimpleTest.waitForExplicitFinish();
12 MochiKit.DOM.addLoadEvent(function () {
14 var canvas = document.getElementById('c');
15 var ctx = canvas.getContext('2d');
17 is(ctx.textBaseline, 'alphabetic', "default textBaseline is not 'alphabetic'");
19 ctx.save();
20 ctx.textBaseline = 'ideographic';
21 is(ctx.textBaseline, 'ideographic', 'textBaseline getter returns incorrect value');
23 ctx.save();
24 ctx.textBaseline = 'top';
25 is(ctx.textBaseline, 'top', 'textBaseline getter returns incorrect value');
27 ctx.save();
28 ctx.textBaseline = 'middle';
29 is(ctx.textBaseline, 'middle', 'textBaseline getter returns incorrect value');
31 ctx.save();
32 ctx.textBaseline = 'bottom';
33 is(ctx.textBaseline, 'bottom', 'textBaseline getter returns incorrect value');
35 ctx.save();
36 ctx.textBaseline = 'hanging';
37 is(ctx.textBaseline, 'hanging', 'textBaseline getter returns incorrect value');
39 ctx.save();
40 ctx.textBaseline = 'alphabetic';
41 is(ctx.textBaseline, 'alphabetic', 'textBaseline getter returns incorrect value');
43 ctx.restore();
44 is(ctx.textBaseline, 'hanging', 'textBaseline not being stored in the context state');
46 ctx.restore();
47 is(ctx.textBaseline, 'bottom', 'textBaseline not being stored in the context state');
49 ctx.restore();
50 is(ctx.textBaseline, 'middle', 'textBaseline not being stored in the context state');
52 ctx.restore();
53 is(ctx.textBaseline, 'top', 'textBaseline not being stored in the context state');
55 ctx.restore();
56 is(ctx.textBaseline, 'ideographic', 'textBaseline not being stored in the context state');
58 ctx.restore();
59 is(ctx.textBaseline, 'alphabetic', 'textBaseline not being stored in the context state');
61 if (!_deferred) SimpleTest.finish();
62 });
63 </script>