Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / canvas-text-alignment.html
blobbe27ad36fdae87bcfddfab005e05ece1e4d415f1
1 <html>
2 <body style="overflow:hidden;">
3 <canvas id="canvas" width=600 height=600 style="border:5px solid black">
4 <script>
5 if (window.testRunner)
6 testRunner.dumpAsTextWithPixelResults();
8 var ctx = document.getElementById('canvas').getContext('2d');
9 var lingrad = ctx.createLinearGradient(0,0,600,600);
10 lingrad.addColorStop(0, '#00ABEB');
11 lingrad.addColorStop(1.0, '#fff');
13 var x = 10;
14 var y = 30;
16 ctx.font = "32px 'Times New Roman'";
17 ctx.fillText("Normal Fill Text", x, y);
19 y += 40;
21 ctx.lineWidth = 2;
22 ctx.strokeText("Normal Stroke Text", x, y);
24 y += 40;
26 ctx.fillStyle = lingrad;
27 ctx.fillText("Gradient Fill Text", x, y);
29 y += 40;
31 ctx.strokeStyle = lingrad;
32 ctx.strokeText("Gradient Stroke Text", x, y);
34 ctx.textAlign = "end";
36 x = 590;
37 y += 40;
39 ctx.fillStyle = 'black';
40 ctx.fillText("Normal Fill Text", x, y);
42 y += 40;
44 ctx.strokeStyle = 'black';
45 ctx.lineWidth = 2;
46 ctx.strokeText("Normal Stroke Text", x, y);
48 y += 40;
50 ctx.fillStyle = lingrad;
51 ctx.fillText("Gradient Fill Text", x, y);
53 y += 40;
55 ctx.strokeStyle = lingrad;
56 ctx.strokeText("Gradient Stroke Text", x, y);
58 y += 40;
59 x = 300;
61 ctx.textAlign = "center";
63 ctx.fillStyle = 'black';
64 ctx.fillText("Normal Fill Text", x, y);
66 y += 40;
68 ctx.strokeStyle = 'black';
69 ctx.lineWidth = 2;
70 ctx.strokeText("Normal Stroke Text", x, y);
72 y += 40;
74 ctx.fillStyle = lingrad;
75 ctx.fillText("Gradient Fill Text", x, y);
77 y += 40;
79 ctx.strokeStyle = lingrad;
80 ctx.strokeText("Gradient Stroke Text", x, y);
82 y += 40;
84 </script>