tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / css / parsing-text-emphasis.html
1 <pre id="console"></pre>
2 <script>
3     if (window.layoutTestController)
4         layoutTestController.dumpAsText();
5
6     function log(message)
7     {
8         document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
9     }
10
11     function test(declaration, expectedColor, expectedPosition, expectedStyle, expectedTextEmphasis)
12     {
13         if (!expectedTextEmphasis)
14             expectedTextEmphasis = "";
15
16         var element = document.createElement("div");
17         element.style.cssText = declaration;
18         var color = element.style.webkitTextEmphasisColor;
19         var position = element.style.webkitTextEmphasisPosition;
20         var style = element.style.webkitTextEmphasisStyle;
21         var textEmphasis = element.style.webkitTextEmphasis;
22         if (color === expectedColor && position === expectedPosition && style === expectedStyle && textEmphasis === expectedTextEmphasis)
23             log("PASS: '" + declaration + "' parsed as ['" + color + "', '" + position + "', '" + style + "', '" + textEmphasis + "']");
24         else
25             log("FAIL: '" + declaration + "' parsed as ['" + color + "', '" + position + "', '" + style + "', '" + textEmphasis + "'] rather than ['" + expectedColor + "', '" + expectedPosition + "', '" + expectedStyle + "', '" + expectedTextEmphasis + "']");
26     }
27
28     test('-webkit-text-emphasis-color: initial;', 'initial', '', '');
29     test('-webkit-text-emphasis-color: inherit;', 'inherit', '', '');
30     test('-webkit-text-emphasis-color: currentcolor;', 'currentcolor', '', '');
31     test('-webkit-text-emphasis-color: cyan;', 'rgb(0, 255, 255)', '', '');
32     test('-webkit-text-emphasis-color: bold;', '', '', '');
33     test('-webkit-text-emphasis-color: 1px;', '', '', '');
34     test('-webkit-text-emphasis-color: "cyan";', '', '', '');
35
36     log("");
37     test('-webkit-text-emphasis-position: initial;', '', 'initial', '');
38     test('-webkit-text-emphasis-position: inherit;', '', 'inherit', '');
39     test('-webkit-text-emphasis-position: over;', '', 'over', '');
40     test('-webkit-text-emphasis-position: under;', '', 'under', '');
41     test('-webkit-text-emphasis-position: bold;', '', '', '');
42     test('-webkit-text-emphasis-position: 1px;', '', '', '');
43     test('-webkit-text-emphasis-position: "over";', '', '', '');
44
45     log("");
46     test('-webkit-text-emphasis-style: initial;', '', '', 'initial');
47     test('-webkit-text-emphasis-style: inherit;', '', '', 'inherit');
48     test('-webkit-text-emphasis-style: none;', '', '', 'none');
49     test('-webkit-text-emphasis-style: filled;', '', '', 'filled');
50     test('-webkit-text-emphasis-style: open;', '', '', 'open');
51     test('-webkit-text-emphasis-style: dot;', '', '', 'dot');
52     test('-webkit-text-emphasis-style: circle;', '', '', 'circle');
53     test('-webkit-text-emphasis-style: double-circle;', '', '', 'double-circle');
54     test('-webkit-text-emphasis-style: triangle;', '', '', 'triangle');
55     test('-webkit-text-emphasis-style: sesame;', '', '', 'sesame');
56     test('-webkit-text-emphasis-style: "cheese";', '', '', 'cheese');
57     test('-webkit-text-emphasis-style: 1px;', '', '', '');
58     test('-webkit-text-emphasis-style: red;', '', '', '');
59
60     test('-webkit-text-emphasis-style: open dot;', '', '', 'open dot');
61     test('-webkit-text-emphasis-style: dot open;', '', '', 'open dot');
62     test('-webkit-text-emphasis-style: dot dot;', '', '', '');
63     test('-webkit-text-emphasis-style: open open;', '', '', '');
64     test('-webkit-text-emphasis-style: none open;', '', '', '');
65     test('-webkit-text-emphasis-style: none none;', '', '', '');
66     test('-webkit-text-emphasis-style: "cheese" open;', '', '', '');
67     test('-webkit-text-emphasis-style: open "cheese";', '', '', '');
68
69     log("");
70     test('-webkit-text-emphasis: initial', '', '', '', 'initial');
71     test('-webkit-text-emphasis: inherit', '', '', '', 'inherit');
72     test('-webkit-text-emphasis: red', 'red', '', 'initial');
73     test('-webkit-text-emphasis: "cheese"', 'initial', '', 'cheese');
74     test('-webkit-text-emphasis: red "cheese"', 'red', '', 'cheese');
75     test('-webkit-text-emphasis: "cheese" red', 'red', '', 'cheese');
76     test('-webkit-text-emphasis: filled sesame red', 'red', '', 'filled sesame');
77     test('-webkit-text-emphasis: red filled sesame', 'red', '', 'filled sesame');
78     test('-webkit-text-emphasis: filled red sesame', '', '', '');
79     test('-webkit-text-emphasis: red sesame filled', 'red', '', 'filled sesame');
80     test('-webkit-text-emphasis: sesame filled red', 'red', '', 'filled sesame');
81 </script>