blob: 3a2bbbe3151e37ee528180e7b9762de018cc92f9 [file] [log] [blame]
<!DOCTYPE html>
<title>Canvas test: 2d.text.baseline.valid</title>
<script src="../tests.js"></script>
<link rel="stylesheet" href="../tests.css">
<body>
<p id="passtext">Pass</p>
<p id="failtext">Fail</p>
<p class="output">These images should be identical:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<ul id="d"></ul>
<script>
_addTest(function(canvas, ctx) {
ctx.textBaseline = 'top';
_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'");
ctx.textBaseline = 'hanging';
_assertSame(ctx.textBaseline, 'hanging', "ctx.textBaseline", "'hanging'");
ctx.textBaseline = 'middle';
_assertSame(ctx.textBaseline, 'middle', "ctx.textBaseline", "'middle'");
ctx.textBaseline = 'alphabetic';
_assertSame(ctx.textBaseline, 'alphabetic', "ctx.textBaseline", "'alphabetic'");
ctx.textBaseline = 'ideographic';
_assertSame(ctx.textBaseline, 'ideographic', "ctx.textBaseline", "'ideographic'");
ctx.textBaseline = 'bottom';
_assertSame(ctx.textBaseline, 'bottom', "ctx.textBaseline", "'bottom'");
});
</script>