Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / parsing-font-variant-ligatures.html
blob1facab519638192f5a66f67936822fbb6e27b00a
1 <pre id="console"></pre>
2 <script>
3 if (window.testRunner)
4 testRunner.dumpAsText();
6 function log(message)
8 document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
11 function test(value, expectedCSSText, expectedComputedCSSText)
13 var element = document.createElement("div");
14 element.style.setProperty("font-variant-ligatures", value);
15 var cssText = element.style.fontVariantLigatures;
16 document.body.appendChild(element);
17 var computedCSSText = getComputedStyle(element).fontVariantLigatures;
18 document.body.removeChild(element);
19 if (cssText === expectedCSSText && computedCSSText == expectedComputedCSSText)
20 log("PASS: '" + value + "' parsed as '" + expectedCSSText + "' and computed to '" + computedCSSText + "'");
21 else {
22 if (cssText !== expectedCSSText)
23 log("FAIL: '" + value + "' parsed as '" + cssText + "' rather than '" + expectedCSSText + "'");
24 if (computedCSSText !== expectedComputedCSSText)
25 log("FAIL: '" + value + "' computed to '" + computedCSSText + "' rather than '" + expectedComputedCSSText + "'");
29 test('initial', 'initial', 'normal');
30 test('inherit', 'inherit', 'normal');
31 test('normal', 'normal', 'normal');
32 test('large', '', 'normal');
33 test('25px', '', 'normal');
34 test('normal normal', '', 'normal');
35 test('normal no-common-ligatures', '', 'normal');
37 log("");
38 test('no-common-ligatures', 'no-common-ligatures', 'no-common-ligatures');
39 test('common-ligatures', 'common-ligatures', 'common-ligatures');
40 test('no-discretionary-ligatures', 'no-discretionary-ligatures', 'no-discretionary-ligatures');
41 test('discretionary-ligatures', 'discretionary-ligatures', 'discretionary-ligatures');
42 test('no-historical-ligatures', 'no-historical-ligatures', 'no-historical-ligatures');
43 test('historical-ligatures', 'historical-ligatures', 'historical-ligatures');
45 log("");
46 test('no-common-ligatures no-common-ligatures', '', 'normal');
47 test('common-ligatures no-discretionary-ligatures', 'common-ligatures no-discretionary-ligatures', 'common-ligatures no-discretionary-ligatures');
48 test('common-ligatures no-discretionary-ligatures historical-ligatures', 'common-ligatures no-discretionary-ligatures historical-ligatures', 'common-ligatures no-discretionary-ligatures historical-ligatures');
49 test('common-ligatures no-discretionary-ligatures normal', '', 'normal');
50 </script>