3 <canvas id=
"canvas" width=
600 height=
300 style=
"border:5px solid black">
6 testRunner
.dumpAsTextWithPixelResults();
8 var ctx
= document
.getElementById('canvas').getContext('2d');
20 ctx
.font
= "32px 'Times New Roman'";
22 var text
= "Baseline";
23 var w
= ctx
.measureText(text
).width
;
24 ctx
.fillText(text
, x
, y
);
28 ctx
.textBaseline
= "top";
29 w
= ctx
.measureText(text
).width
;
30 ctx
.fillText(text
, x
, y
);
34 ctx
.textBaseline
= "bottom";
35 w
= ctx
.measureText(text
).width
;
36 ctx
.fillText(text
, x
, y
);
40 ctx
.textBaseline
= "middle";
41 w
= ctx
.measureText(text
).width
;
42 ctx
.fillText(text
, x
, y
);