1<!doctype HTML>
2<html>
3 <head>
4 <title>HTML5 Canvas Test: Ignore property-independent style sheet syntax "inherit" in Text</title>
5 <link rel="author" title="Microsoft" href="http://www.microsoft.com" />
6 <link rel="help" href="http://www.w3.org/TR/2dcontext/#dom-context-2d-font" />
7 <meta name="assert" content=": Ignore 'inherit' property-independent style sheet syntax without assigning a new font value." />
8 <script type="text/javascript">
9 function runTest()
10 {
11 var canvas = document.getElementById("canvas1");
12 var ctx = canvas.getContext("2d");
13
14 // Assign a valid font.
15 ctx.font = "40px Times New Roman";
16
17 // Assign property-independent style sheet syntax 'inherit' as font.
18 ctx.font = "20px inherit";
19 ctx.fillText("Test String", 5, 50);
20
21 // Assign property-independent style sheet syntax 'inherit' as font.
22 ctx.font = "inherit";
23 ctx.fillText("Test String", 5, 100);
24
25 // Assign property-independent style sheet syntax 'inherit' as font.
26 ctx.font = "INHERIT";
27 ctx.fillText("Test String", 5, 150);
28
29 // Assign property-independent style sheet syntax 'inherit' as font.
30 ctx.font = "inherit 20px";
31 ctx.fillText("Test String", 5, 200);
32
33 // Assign property-independent style sheet syntax 'inherit' as font.
34 ctx.font = "Inheritance 20px";
35 ctx.fillText("Test String", 5, 250);
36
37 // Assign a valid font which was used earlier.
38 ctx.font = "40px Times New Roman";
39 ctx.fillText("Test String", 5, 300);
40 }
41 </script>
42 </head>
43
44 <body onload="runTest()">
45 <p>Description: Ignore "inherit" property-independent style sheet syntax without assigning a new font value.</p>
46 <p>Test passes if All strings are identical in both size, style, and text.</p>
47 <canvas id="canvas1" width="300" height="400">Browser does not support HTML5 Canvas.</canvas>
48 </body>
49</html>