font-variant-* properties in @font-face declarations should be honored
[WebKit-https.git] / LayoutTests / css3 / font-variant-font-face-all.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 </head>
5 <body>
6 <p>This test is a dump-render-tree test which makes sure that the following properties are appropriately applied:</p>
7 <ul>
8 <li>-webkit-font-variant-ligatures</li>
9 <li>-webkit-font-variant-position</li>
10 <li>-webkit-font-variant-caps</li>
11 <li>-webkit-font-variant-numeric</li>
12 <li>-webkit-font-variant-alternates</li>
13 <li>-webkit-font-variant-east-asian</li>
14 </ul>
15 The test passes if there is a particular sequence of checks and x characters below. Note that some x characters are expected.
16 <div id="insertionPoint"></div>
17 <div id="insertionPoint2"></div>
18 <script>
19 var insertionPoint = document.getElementById("insertionPoint");
20 var insertionPoint2 = document.getElementById("insertionPoint2");
21
22 var styleNode = document.createElement("style");
23 document.head.appendChild(styleNode);
24
25 function addElement(pointToInsert, fontFamily, extension, format, property, value, text) {
26     styleNode.sheet.insertRule("@font-face { font-family: " + fontFamily + "_" + property + "_" + value + "; src: url('resources/FontWithFeatures." + extension + "') format('" + format + "'); " + property + ": " + value + "; }", 0);
27     var element = document.createElement("span");
28     element.textContent = text + text;
29     element.style.fontFamily = fontFamily + "_" + property + "_" + value;
30     pointToInsert.appendChild(element);
31     pointToInsert.appendChild(document.createTextNode(" "));
32 }
33
34 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "common-ligatures", "C");
35 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-common-ligatures", "C");
36 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "discretionary-ligatures", "E");
37 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-discretionary-ligatures", "E");
38 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "historical-ligatures", "F");
39 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-historical-ligatures", "F");
40 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "contextual", "G");
41 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-contextual", "G");
42 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-position", "sub", "H");
43 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-position", "super", "I");
44 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "small-caps", "J");
45 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "all-small-caps", "J");
46 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "petite-caps", "L");
47 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "all-petite-caps", "L");
48 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "unicase", "N");
49 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "titling-caps", "O");
50 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "lining-nums", "P");
51 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "oldstyle-nums", "Q");
52 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "proportional-nums", "R");
53 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "tabular-nums", "S");
54 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "diagonal-fractions", "T");
55 //addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "stacked-fractions", "U");
56 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "ordinal", "V");
57 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "slashed-zero", "W");
58 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-alternates", "historical-forms", "X");
59 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis78", "Y");
60 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis83", "Z");
61 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis90", "a");
62 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis04", "b");
63 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "simplified", "c");
64 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "traditional", "d");
65 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "full-width", "e");
66 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "proportional-width", "f");
67 addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "ruby", "g");
68
69 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "common-ligatures", "C");
70 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-common-ligatures", "C");
71 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "discretionary-ligatures", "G");
72 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-discretionary-ligatures", "G");
73 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "historical-ligatures", "I");
74 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-historical-ligatures", "I");
75 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "contextual", "L");
76 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-contextual", "L");
77 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-position", "sub", "O");
78 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-position", "super", "P");
79 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "small-caps", "S");
80 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "all-small-caps", "S");
81 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "petite-caps", "T");
82 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "all-petite-caps", "T");
83 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "unicase", "Y");
84 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "titling-caps", "a");
85 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "lining-nums", "c");
86 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "oldstyle-nums", "d");
87 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "proportional-nums", "f");
88 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "tabular-nums", "g");
89 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "diagonal-fractions", "i");
90 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "stacked-fractions", "j");
91 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "ordinal", "Q");
92 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "slashed-zero", "k");
93 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-alternates", "historical-forms", "K");
94 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis78", "m");
95 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis83", "n");
96 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis90", "o");
97 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis04", "p");
98 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "simplified", "q");
99 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "traditional", "r");
100 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "full-width", "t");
101 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "proportional-width", "u");
102 addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "ruby", "v");
103 </script>
104 </body>
105 </html>