Fixed time zone calculation issue
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / js / 3rdParty / codemirror / mode / css / test.js
1 (function() {
2 var mode = CodeMirror.getMode({tabSize: 4}, "css");
3 function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
4
5 // Requires at least one media query
6 MT("atMediaEmpty",
7 "[def @media] [error {] }");
8
9 MT("atMediaMultiple",
10 "[def @media] [keyword not] [attribute screen] [operator and] ([property color]), [keyword not] [attribute print] [operator and] ([property color]) { }");
11
12 MT("atMediaCheckStack",
13 "[def @media] [attribute screen] { } [tag foo] { }");
14
15 MT("atMediaCheckStack",
16 "[def @media] [attribute screen] ([property color]) { } [tag foo] { }");
17
18 MT("atMediaCheckStackInvalidAttribute",
19 "[def @media] [attribute&error foobarhello] { } [tag foo] { }");
20
21 // Error, because "and" is only allowed immediately preceding a media expression
22 MT("atMediaInvalidAttribute",
23 "[def @media] [attribute&error foobarhello] { }");
24
25 // Error, because "and" is only allowed immediately preceding a media expression
26 MT("atMediaInvalidAnd",
27 "[def @media] [error and] [attribute screen] { }");
28
29 // Error, because "not" is only allowed as the first item in each media query
30 MT("atMediaInvalidNot",
31 "[def @media] [attribute screen] [error not] ([error not]) { }");
32
33 // Error, because "only" is only allowed as the first item in each media query
34 MT("atMediaInvalidOnly",
35 "[def @media] [attribute screen] [error only] ([error only]) { }");
36
37 // Error, because "foobarhello" is neither a known type or property, but
38 // property was expected (after "and"), and it should be in parenthese.
39 MT("atMediaUnknownType",
40 "[def @media] [attribute screen] [operator and] [error foobarhello] { }");
41
42 // Error, because "color" is not a known type, but is a known property, and
43 // should be in parentheses.
44 MT("atMediaInvalidType",
45 "[def @media] [attribute screen] [operator and] [error color] { }");
46
47 // Error, because "print" is not a known property, but is a known type,
48 // and should not be in parenthese.
49 MT("atMediaInvalidProperty",
50 "[def @media] [attribute screen] [operator and] ([error print]) { }");
51
52 // Soft error, because "foobarhello" is not a known property or type.
53 MT("atMediaUnknownProperty",
54 "[def @media] [attribute screen] [operator and] ([property&error foobarhello]) { }");
55
56 MT("tagSelector",
57 "[tag foo] { }");
58
59 MT("classSelector",
60 "[qualifier .foo-bar_hello] { }");
61
62 MT("idSelector",
63 "[builtin #foo] { [error #foo] }");
64
65 MT("tagSelectorUnclosed",
66 "[tag foo] { [property margin][operator :] [number 0] } [tag bar] { }");
67
68 MT("tagStringNoQuotes",
69 "[tag foo] { [property font-family][operator :] [variable-2 hello] [variable-2 world]; }");
70
71 MT("tagStringDouble",
72 "[tag foo] { [property font-family][operator :] [string \"hello world\"]; }");
73
74 MT("tagStringSingle",
75 "[tag foo] { [property font-family][operator :] [string 'hello world']; }");
76
77 MT("tagColorKeyword",
78 "[tag foo] {" +
79 "[property color][operator :] [keyword black];" +
80 "[property color][operator :] [keyword navy];" +
81 "[property color][operator :] [keyword yellow];" +
82 "}");
83
84 MT("tagColorHex3",
85 "[tag foo] { [property background][operator :] [atom #fff]; }");
86
87 MT("tagColorHex6",
88 "[tag foo] { [property background][operator :] [atom #ffffff]; }");
89
90 MT("tagColorHex4",
91 "[tag foo] { [property background][operator :] [atom&error #ffff]; }");
92
93 MT("tagColorHexInvalid",
94 "[tag foo] { [property background][operator :] [atom&error #ffg]; }");
95
96 MT("tagNegativeNumber",
97 "[tag foo] { [property margin][operator :] [number -5px]; }");
98
99 MT("tagPositiveNumber",
100 "[tag foo] { [property padding][operator :] [number 5px]; }");
101
102 MT("tagVendor",
103 "[tag foo] { [meta -foo-][property box-sizing][operator :] [meta -foo-][string-2 border-box]; }");
104
105 MT("tagBogusProperty",
106 "[tag foo] { [property&error barhelloworld][operator :] [number 0]; }");
107
108 MT("tagTwoProperties",
109 "[tag foo] { [property margin][operator :] [number 0]; [property padding][operator :] [number 0]; }");
110
111 MT("commentSGML",
112 "[comment <!--comment-->]");
113 })();