Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / css / parsing-font-variant-ligatures.html
1 <pre id="console"></pre>
2 <script>
3     if (window.testRunner)
4         testRunner.dumpAsText();
5
6     function log(message)
7     {
8         document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
9     }
10
11     function test(value, expectedCSSText, expectedComputedCSSText)
12     {
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 + "'");
26         }
27     }
28
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');
36
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');
44
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>