4 <title>Media Queries Self-Contained Test Suite
</title>
5 <link rel=
"author" title=
"L. David Baron" href=
"http://dbaron.org/">
6 <link rel=
"author" title=
"Anne van Kesteren" href=
"http://annevankesteren.nl/">
7 <link rel=
"author" title=
"Ms2ger" href=
"mailto:Ms2ger@gmail.com">
8 <link rel=
"help" href=
"http://www.w3.org/TR/css3-mediaqueries/">
9 <script type=
"text/javascript" src=
"../../../resources/testharness.js"></script>
10 <script type=
"text/javascript" src=
"../../../resources/testharnessreport.js"></script>
11 <script id=
"metadata_cache">/*
13 "subtest_1": {
"assert":
"query (orientation) should be parseable" },
14 "subtest_2": {
"assert":
"query not (orientation) should not be parseable" },
15 "subtest_3": {
"assert":
"query only (orientation) should not be parseable" },
16 "subtest_4": {
"assert":
"query all and (orientation) should be parseable" },
17 "subtest_5": {
"assert":
"query not all and (orientation) should be parseable" },
18 "subtest_6": {
"assert":
"query only all and (orientation) should be parseable" },
19 "subtest_7": {
"assert":
"expression width should be parseable" },
20 "subtest_8": {
"assert":
"expression width: 0 should be parseable" },
21 "subtest_9": {
"assert":
"expression width: 0px should be parseable" },
22 "subtest_10": {
"assert":
"expression width: 0em should be parseable" },
23 "subtest_11": {
"assert":
"expression width: -0 should be parseable" },
24 "subtest_12": {
"assert":
"expression min-width: -0 should be parseable" },
25 "subtest_13": {
"assert":
"expression max-width: -0 should be parseable" },
26 "subtest_14": {
"assert":
"expression width: -0cm should be parseable" },
27 "subtest_15": {
"assert":
"expression width: 1px should be parseable" },
28 "subtest_16": {
"assert":
"expression width: 0.001mm should be parseable" },
29 "subtest_17": {
"assert":
"expression width: 100000px should be parseable" },
30 "subtest_18": {
"assert":
"expression width: -1px should not be parseable" },
31 "subtest_19": {
"assert":
"expression min-width: -1px should not be parseable" },
32 "subtest_20": {
"assert":
"expression max-width: -1px should not be parseable" },
33 "subtest_21": {
"assert":
"expression width: -0.00001mm should not be parseable" },
34 "subtest_22": {
"assert":
"expression width: -100000em should not be parseable" },
35 "subtest_23": {
"assert":
"expression min-width should not be parseable" },
36 "subtest_24": {
"assert":
"expression max-width should not be parseable" },
37 "subtest_25": {
"assert":
"expression height should be parseable" },
38 "subtest_26": {
"assert":
"expression height: 0 should be parseable" },
39 "subtest_27": {
"assert":
"expression height: 0px should be parseable" },
40 "subtest_28": {
"assert":
"expression height: 0em should be parseable" },
41 "subtest_29": {
"assert":
"expression height: -0 should be parseable" },
42 "subtest_30": {
"assert":
"expression min-height: -0 should be parseable" },
43 "subtest_31": {
"assert":
"expression max-height: -0 should be parseable" },
44 "subtest_32": {
"assert":
"expression height: -0cm should be parseable" },
45 "subtest_33": {
"assert":
"expression height: 1px should be parseable" },
46 "subtest_34": {
"assert":
"expression height: 0.001mm should be parseable" },
47 "subtest_35": {
"assert":
"expression height: 100000px should be parseable" },
48 "subtest_36": {
"assert":
"expression height: -1px should not be parseable" },
49 "subtest_37": {
"assert":
"expression min-height: -1px should not be parseable" },
50 "subtest_38": {
"assert":
"expression max-height: -1px should not be parseable" },
51 "subtest_39": {
"assert":
"expression height: -0.00001mm should not be parseable" },
52 "subtest_40": {
"assert":
"expression height: -100000em should not be parseable" },
53 "subtest_41": {
"assert":
"expression min-height should not be parseable" },
54 "subtest_42": {
"assert":
"expression max-height should not be parseable" },
55 "subtest_43": {
"assert":
"expression device-width should be parseable" },
56 "subtest_44": {
"assert":
"expression device-width: 0 should be parseable" },
57 "subtest_45": {
"assert":
"expression device-width: 0px should be parseable" },
58 "subtest_46": {
"assert":
"expression device-width: 0em should be parseable" },
59 "subtest_47": {
"assert":
"expression device-width: -0 should be parseable" },
60 "subtest_48": {
"assert":
"expression min-device-width: -0 should be parseable" },
61 "subtest_49": {
"assert":
"expression max-device-width: -0 should be parseable" },
62 "subtest_50": {
"assert":
"expression device-width: -0cm should be parseable" },
63 "subtest_51": {
"assert":
"expression device-width: 1px should be parseable" },
64 "subtest_52": {
"assert":
"expression device-width: 0.001mm should be parseable" },
65 "subtest_53": {
"assert":
"expression device-width: 100000px should be parseable" },
66 "subtest_54": {
"assert":
"expression device-width: -1px should not be parseable" },
67 "subtest_55": {
"assert":
"expression min-device-width: -1px should not be parseable" },
68 "subtest_56": {
"assert":
"expression max-device-width: -1px should not be parseable" },
69 "subtest_57": {
"assert":
"expression device-width: -0.00001mm should not be parseable" },
70 "subtest_58": {
"assert":
"expression device-width: -100000em should not be parseable" },
71 "subtest_59": {
"assert":
"expression min-device-width should not be parseable" },
72 "subtest_60": {
"assert":
"expression max-device-width should not be parseable" },
73 "subtest_61": {
"assert":
"expression device-height should be parseable" },
74 "subtest_62": {
"assert":
"expression device-height: 0 should be parseable" },
75 "subtest_63": {
"assert":
"expression device-height: 0px should be parseable" },
76 "subtest_64": {
"assert":
"expression device-height: 0em should be parseable" },
77 "subtest_65": {
"assert":
"expression device-height: -0 should be parseable" },
78 "subtest_66": {
"assert":
"expression min-device-height: -0 should be parseable" },
79 "subtest_67": {
"assert":
"expression max-device-height: -0 should be parseable" },
80 "subtest_68": {
"assert":
"expression device-height: -0cm should be parseable" },
81 "subtest_69": {
"assert":
"expression device-height: 1px should be parseable" },
82 "subtest_70": {
"assert":
"expression device-height: 0.001mm should be parseable" },
83 "subtest_71": {
"assert":
"expression device-height: 100000px should be parseable" },
84 "subtest_72": {
"assert":
"expression device-height: -1px should not be parseable" },
85 "subtest_73": {
"assert":
"expression min-device-height: -1px should not be parseable" },
86 "subtest_74": {
"assert":
"expression max-device-height: -1px should not be parseable" },
87 "subtest_75": {
"assert":
"expression device-height: -0.00001mm should not be parseable" },
88 "subtest_76": {
"assert":
"expression device-height: -100000em should not be parseable" },
89 "subtest_77": {
"assert":
"expression min-device-height should not be parseable" },
90 "subtest_78": {
"assert":
"expression max-device-height should not be parseable" },
91 "subtest_79": {
"assert":
"all and (width: 117px) should apply" },
92 "subtest_80": {
"assert":
"all and (width: 118px) should not apply" },
93 "subtest_81": {
"assert":
"all and (width: 116px) should not apply" },
94 "subtest_82": {
"assert":
"all and (min-width: 117px) should apply" },
95 "subtest_83": {
"assert":
"all and (min-width: 118px) should not apply" },
96 "subtest_84": {
"assert":
"all and (min-width: 116px) should apply" },
97 "subtest_85": {
"assert":
"all and (max-width: 117px) should apply" },
98 "subtest_86": {
"assert":
"all and (max-width: 118px) should apply" },
99 "subtest_87": {
"assert":
"all and (max-width: 116px) should not apply" },
100 "subtest_88": {
"assert":
"all and (min-width: 9em) should not apply" },
101 "subtest_89": {
"assert":
"all and (min-width: 6em) should apply" },
102 "subtest_90": {
"assert":
"all and (max-width: 9em) should apply" },
103 "subtest_91": {
"assert":
"all and (max-width: 6em) should not apply" },
104 "subtest_92": {
"assert":
"all and (height: 76px) should apply" },
105 "subtest_93": {
"assert":
"all and (height: 77px) should not apply" },
106 "subtest_94": {
"assert":
"all and (height: 75px) should not apply" },
107 "subtest_95": {
"assert":
"all and (min-height: 76px) should apply" },
108 "subtest_96": {
"assert":
"all and (min-height: 77px) should not apply" },
109 "subtest_97": {
"assert":
"all and (min-height: 75px) should apply" },
110 "subtest_98": {
"assert":
"all and (max-height: 76px) should apply" },
111 "subtest_99": {
"assert":
"all and (max-height: 77px) should apply" },
112 "subtest_100": {
"assert":
"all and (max-height: 75px) should not apply" },
113 "subtest_101": {
"assert":
"all and (min-height: 6em) should not apply" },
114 "subtest_102": {
"assert":
"all and (min-height: 3em) should apply" },
115 "subtest_103": {
"assert":
"all and (max-height: 6em) should apply" },
116 "subtest_104": {
"assert":
"all and (max-height: 3em) should not apply" },
117 "subtest_105": {
"assert":
"all and (device-width: 1920px) should apply" },
118 "subtest_106": {
"assert":
"all and (device-width: 1921px) should not apply" },
119 "subtest_107": {
"assert":
"all and (device-width: 1919px) should not apply" },
120 "subtest_108": {
"assert":
"all and (min-device-width: 1920px) should apply" },
121 "subtest_109": {
"assert":
"all and (min-device-width: 1921px) should not apply" },
122 "subtest_110": {
"assert":
"all and (min-device-width: 1919px) should apply" },
123 "subtest_111": {
"assert":
"all and (max-device-width: 1920px) should apply" },
124 "subtest_112": {
"assert":
"all and (max-device-width: 1921px) should apply" },
125 "subtest_113": {
"assert":
"all and (max-device-width: 1919px) should not apply" },
126 "subtest_114": {
"assert":
"all and (min-device-width: 121em) should not apply" },
127 "subtest_115": {
"assert":
"all and (min-device-width: 119em) should apply" },
128 "subtest_116": {
"assert":
"all and (max-device-width: 121em) should apply" },
129 "subtest_117": {
"assert":
"all and (max-device-width: 119em) should not apply" },
130 "subtest_118": {
"assert":
"all and (device-height: 1200px) should apply" },
131 "subtest_119": {
"assert":
"all and (device-height: 1201px) should not apply" },
132 "subtest_120": {
"assert":
"all and (device-height: 1199px) should not apply" },
133 "subtest_121": {
"assert":
"all and (min-device-height: 1200px) should apply" },
134 "subtest_122": {
"assert":
"all and (min-device-height: 1201px) should not apply" },
135 "subtest_123": {
"assert":
"all and (min-device-height: 1199px) should apply" },
136 "subtest_124": {
"assert":
"all and (max-device-height: 1200px) should apply" },
137 "subtest_125": {
"assert":
"all and (max-device-height: 1201px) should apply" },
138 "subtest_126": {
"assert":
"all and (max-device-height: 1199px) should not apply" },
139 "subtest_127": {
"assert":
"all and (min-device-height: 76em) should not apply" },
140 "subtest_128": {
"assert":
"all and (min-device-height: 74em) should apply" },
141 "subtest_129": {
"assert":
"all and (max-device-height: 76em) should apply" },
142 "subtest_130": {
"assert":
"all and (max-device-height: 74em) should not apply" },
143 "subtest_131": {
"assert":
"all and (height) should apply" },
144 "subtest_132": {
"assert":
"all and (width) should not apply" },
145 "subtest_133": {
"assert":
"all and (height) should not apply" },
146 "subtest_134": {
"assert":
"all and (width) should not apply" },
147 "subtest_135": {
"assert":
"all and (device-height) should apply" },
148 "subtest_136": {
"assert":
"all and (device-width) should apply" },
149 "subtest_137": {
"assert":
"all and (height) should not apply" },
150 "subtest_138": {
"assert":
"all and (width) should apply" },
151 "subtest_139": {
"assert":
"all and (height) should apply" },
152 "subtest_140": {
"assert":
"all and (width) should apply" },
153 "subtest_141": {
"assert":
"expression orientation should be parseable" },
154 "subtest_142": {
"assert":
"expression orientation: portrait should be parseable" },
155 "subtest_143": {
"assert":
"expression orientation: landscape should be parseable" },
156 "subtest_144": {
"assert":
"expression min-orientation should not be parseable" },
157 "subtest_145": {
"assert":
"expression min-orientation: portrait should not be parseable" },
158 "subtest_146": {
"assert":
"expression min-orientation: landscape should not be parseable" },
159 "subtest_147": {
"assert":
"expression max-orientation should not be parseable" },
160 "subtest_148": {
"assert":
"expression max-orientation: portrait should not be parseable" },
161 "subtest_149": {
"assert":
"expression max-orientation: landscape should not be parseable" },
162 "subtest_150": {
"assert":
"(orientation) should apply" },
163 "subtest_151": {
"assert":
"(orientation: landscape) should apply" },
164 "subtest_152": {
"assert":
"(orientation: portrait) should not apply" },
165 "subtest_153": {
"assert":
"not all and (orientation: portrait) should apply" },
166 "subtest_154": {
"assert":
"(orientation) should apply" },
167 "subtest_155": {
"assert":
"(orientation: landscape) should not apply" },
168 "subtest_156": {
"assert":
"not all and (orientation: landscape) should apply" },
169 "subtest_157": {
"assert":
"(orientation: portrait) should apply" },
170 "subtest_158": {
"assert":
"(aspect-ratio: 59/80) should apply" },
171 "subtest_159": {
"assert":
"(aspect-ratio: 58/80) should not apply" },
172 "subtest_160": {
"assert":
"(aspect-ratio: 59/81) should not apply" },
173 "subtest_161": {
"assert":
"(aspect-ratio: 60/80) should not apply" },
174 "subtest_162": {
"assert":
"(aspect-ratio: 59/79) should not apply" },
175 "subtest_163": {
"assert":
"(aspect-ratio: 177/240) should apply" },
176 "subtest_164": {
"assert":
"(aspect-ratio: 413/560) should apply" },
177 "subtest_165": {
"assert":
"(aspect-ratio: 5900/8000) should apply" },
178 "subtest_166": {
"assert":
"(aspect-ratio: 5901/8000) should not apply" },
179 "subtest_167": {
"assert":
"(aspect-ratio: 5899/8000) should not apply" },
180 "subtest_168": {
"assert":
"(aspect-ratio: 5900/8001) should not apply" },
181 "subtest_169": {
"assert":
"(aspect-ratio: 5900/7999) should not apply" },
182 "subtest_170": {
"assert":
"(aspect-ratio) should apply" },
183 "subtest_171": {
"assert":
"(min-aspect-ratio: 59/80) should apply" },
184 "subtest_172": {
"assert":
"(min-aspect-ratio: 58/80) should apply" },
185 "subtest_173": {
"assert":
"(min-aspect-ratio: 59/81) should apply" },
186 "subtest_174": {
"assert":
"(min-aspect-ratio: 60/80) should not apply" },
187 "subtest_175": {
"assert":
"(min-aspect-ratio: 59/79) should not apply" },
188 "subtest_176": {
"assert":
"expression min-aspect-ratio should not be parseable" },
189 "subtest_177": {
"assert":
"(max-aspect-ratio: 59/80) should apply" },
190 "subtest_178": {
"assert":
"(max-aspect-ratio: 58/80) should not apply" },
191 "subtest_179": {
"assert":
"(max-aspect-ratio: 59/81) should not apply" },
192 "subtest_180": {
"assert":
"(max-aspect-ratio: 60/80) should apply" },
193 "subtest_181": {
"assert":
"(max-aspect-ratio: 59/79) should apply" },
194 "subtest_182": {
"assert":
"expression max-aspect-ratio should not be parseable" },
195 "subtest_183": {
"assert":
"(device-aspect-ratio: 1920/1200) should apply" },
196 "subtest_184": {
"assert":
"not all and (device-aspect-ratio: 1921/1200) should apply" },
197 "subtest_185": {
"assert":
"all and (device-aspect-ratio: 1920/1199) should not apply" },
198 "subtest_186": {
"assert":
"all and (device-aspect-ratio: 1919/1200) should not apply" },
199 "subtest_187": {
"assert":
"not all and (device-aspect-ratio: 1920/1201) should apply" },
200 "subtest_188": {
"assert":
"(device-aspect-ratio) should apply" },
201 "subtest_189": {
"assert":
"(min-device-aspect-ratio: 1920/1200) should apply" },
202 "subtest_190": {
"assert":
"all and (min-device-aspect-ratio: 1921/1200) should not apply" },
203 "subtest_191": {
"assert":
"not all and (min-device-aspect-ratio: 1920/1199) should apply" },
204 "subtest_192": {
"assert":
"not all and (min-device-aspect-ratio: 1919/1200) should not apply" },
205 "subtest_193": {
"assert":
"all and (min-device-aspect-ratio: 1920/1201) should apply" },
206 "subtest_194": {
"assert":
"expression min-device-aspect-ratio should not be parseable" },
207 "subtest_195": {
"assert":
"all and (max-device-aspect-ratio: 1920/1200) should apply" },
208 "subtest_196": {
"assert":
"(max-device-aspect-ratio: 1921/1200) should apply" },
209 "subtest_197": {
"assert":
"(max-device-aspect-ratio: 1920/1199) should apply" },
210 "subtest_198": {
"assert":
"all and (max-device-aspect-ratio: 1919/1200) should not apply" },
211 "subtest_199": {
"assert":
"not all and (max-device-aspect-ratio: 1920/1201) should apply" },
212 "subtest_200": {
"assert":
"expression max-device-aspect-ratio should not be parseable" },
213 "subtest_201": {
"assert":
"expression max-aspect-ratio: 1/1 should be parseable" },
214 "subtest_202": {
"assert":
"expression max-aspect-ratio: 1 /1 should be parseable" },
215 "subtest_203": {
"assert":
"expression max-aspect-ratio: 1 / \t\n1 should be parseable" },
216 "subtest_204": {
"assert":
"expression max-aspect-ratio: 1/\r1 should be parseable" },
217 "subtest_205": {
"assert":
"expression max-aspect-ratio: 1 should not be parseable" },
218 "subtest_206": {
"assert":
"expression max-aspect-ratio: 0.5 should not be parseable" },
219 "subtest_207": {
"assert":
"expression max-aspect-ratio: 1.0/1 should not be parseable" },
220 "subtest_208": {
"assert":
"expression max-aspect-ratio: 1/1.0 should not be parseable" },
221 "subtest_209": {
"assert":
"expression max-aspect-ratio: 1.0/1.0 should not be parseable" },
222 "subtest_210": {
"assert":
"expression max-aspect-ratio: 0/1 should not be parseable" },
223 "subtest_211": {
"assert":
"expression max-aspect-ratio: 1/0 should not be parseable" },
224 "subtest_212": {
"assert":
"expression max-aspect-ratio: 0/0 should not be parseable" },
225 "subtest_213": {
"assert":
"expression max-aspect-ratio: -1/1 should not be parseable" },
226 "subtest_214": {
"assert":
"expression max-aspect-ratio: 1/-1 should not be parseable" },
227 "subtest_215": {
"assert":
"expression max-aspect-ratio: -1/-1 should not be parseable" },
228 "subtest_216": {
"assert":
"expression device-aspect-ratio: 1/1 should be parseable" },
229 "subtest_217": {
"assert":
"expression device-aspect-ratio: 1 /1 should be parseable" },
230 "subtest_218": {
"assert":
"expression device-aspect-ratio: 1 / \t\n1 should be parseable" },
231 "subtest_219": {
"assert":
"expression device-aspect-ratio: 1/\r1 should be parseable" },
232 "subtest_220": {
"assert":
"expression device-aspect-ratio: 1 should not be parseable" },
233 "subtest_221": {
"assert":
"expression device-aspect-ratio: 0.5 should not be parseable" },
234 "subtest_222": {
"assert":
"expression device-aspect-ratio: 1.0/1 should not be parseable" },
235 "subtest_223": {
"assert":
"expression device-aspect-ratio: 1/1.0 should not be parseable" },
236 "subtest_224": {
"assert":
"expression device-aspect-ratio: 1.0/1.0 should not be parseable" },
237 "subtest_225": {
"assert":
"expression device-aspect-ratio: 0/1 should not be parseable" },
238 "subtest_226": {
"assert":
"expression device-aspect-ratio: 1/0 should not be parseable" },
239 "subtest_227": {
"assert":
"expression device-aspect-ratio: 0/0 should not be parseable" },
240 "subtest_228": {
"assert":
"expression device-aspect-ratio: -1/1 should not be parseable" },
241 "subtest_229": {
"assert":
"expression device-aspect-ratio: 1/-1 should not be parseable" },
242 "subtest_230": {
"assert":
"expression device-aspect-ratio: -1/-1 should not be parseable" },
243 "monochrome_and_color": {},
245 "subtest_231": {
"assert":
"all and (color:8) should apply" },
246 "subtest_232": {
"assert":
"all and (color:7) should not apply" },
247 "subtest_233": {
"assert":
"all and (color:9) should not apply" },
248 "subtest_234": {
"assert":
"all and (max-color:8) should apply" },
249 "subtest_235": {
"assert":
"all and (max-color:7) should not apply" },
250 "subtest_236": {
"assert":
"all and (max-color:9) should apply" },
251 "subtest_237": {
"assert":
"all and (color) should apply" },
252 "subtest_238": {
"assert":
"expression max-color should not be parseable" },
253 "subtest_239": {
"assert":
"expression min-color should not be parseable" },
254 "subtest_240": {
"assert":
"all and (monochrome) should not apply" },
255 "subtest_241": {
"assert":
"expression max-monochrome should not be parseable" },
256 "subtest_242": {
"assert":
"expression min-monochrome should not be parseable" },
257 "subtest_243": {
"assert":
"not all and (monochrome) should apply" },
258 "subtest_244": {
"assert":
"not all and (color) should not apply" },
259 "subtest_245": {
"assert":
"only all and (color) should apply" },
260 "subtest_246": {
"assert":
"only all and (monochrome) should not apply" },
261 "subtest_247": {
"assert":
"expression color: 1 should be parseable" },
262 "subtest_248": {
"assert":
"expression color: 327 should be parseable" },
263 "subtest_249": {
"assert":
"expression color: 0 should be parseable" },
264 "subtest_250": {
"assert":
"expression color: 1.0 should not be parseable" },
265 "subtest_251": {
"assert":
"expression color: -1 should not be parseable" },
266 "subtest_252": {
"assert":
"expression color: 1/1 should not be parseable" },
267 "subtest_253": {
"assert":
"expression min-monochrome: 1 should be parseable" },
268 "subtest_254": {
"assert":
"expression min-monochrome: 327 should be parseable" },
269 "subtest_255": {
"assert":
"expression min-monochrome: 0 should be parseable" },
270 "subtest_256": {
"assert":
"expression min-monochrome: 1.0 should not be parseable" },
271 "subtest_257": {
"assert":
"expression min-monochrome: -1 should not be parseable" },
272 "subtest_258": {
"assert":
"expression min-monochrome: 1/1 should not be parseable" },
273 "subtest_259": {
"assert":
"expression max-color-index: 1 should be parseable" },
274 "subtest_260": {
"assert":
"expression max-color-index: 327 should be parseable" },
275 "subtest_261": {
"assert":
"expression max-color-index: 0 should be parseable" },
276 "subtest_262": {
"assert":
"expression max-color-index: 1.0 should not be parseable" },
277 "subtest_263": {
"assert":
"expression max-color-index: -1 should not be parseable" },
278 "subtest_264": {
"assert":
"expression max-color-index: 1/1 should not be parseable" },
279 "subtest_265": {
"assert":
"(color-index: 0) should apply" },
280 "subtest_266": {
"assert":
"(color-index: 1) should not apply" },
281 "subtest_267": {
"assert":
"(min-color-index: 0) should apply" },
282 "subtest_268": {
"assert":
"(min-color-index: 1) should not apply" },
283 "subtest_269": {
"assert":
"(max-color-index: 0) should apply" },
284 "subtest_270": {
"assert":
"(max-color-index: 1) should apply" },
285 "subtest_271": {
"assert":
"(max-color-index: 157) should apply" },
286 "subtest_272": {
"assert":
"expression resolution: 3dpi should be parseable" },
287 "subtest_273": {
"assert":
"expression resolution:3dpi should be parseable" },
288 "subtest_274": {
"assert":
"expression resolution: 3.0dpi should be parseable" },
289 "subtest_275": {
"assert":
"expression resolution: 3.4dpi should be parseable" },
290 "subtest_276": {
"assert":
"expression resolution\t: 120dpcm should be parseable" },
291 "subtest_277": {
"assert":
"expression resolution: 0dpi should not be parseable" },
292 "subtest_278": {
"assert":
"expression resolution: -3dpi should not be parseable" },
293 "subtest_279": {
"assert":
"expression min-resolution: 3dpi should be parseable" },
294 "subtest_280": {
"assert":
"expression min-resolution:3dpi should be parseable" },
295 "subtest_281": {
"assert":
"expression min-resolution: 3.0dpi should be parseable" },
296 "subtest_282": {
"assert":
"expression min-resolution: 3.4dpi should be parseable" },
297 "subtest_283": {
"assert":
"expression min-resolution\t: 120dpcm should be parseable" },
298 "subtest_284": {
"assert":
"expression min-resolution: 0dpi should not be parseable" },
299 "subtest_285": {
"assert":
"expression min-resolution: -3dpi should not be parseable" },
300 "subtest_286": {
"assert":
"expression max-resolution: 3dpi should be parseable" },
301 "subtest_287": {
"assert":
"expression max-resolution:3dpi should be parseable" },
302 "subtest_288": {
"assert":
"expression max-resolution: 3.0dpi should be parseable" },
303 "subtest_289": {
"assert":
"expression max-resolution: 3.4dpi should be parseable" },
304 "subtest_290": {
"assert":
"expression max-resolution\t: 120dpcm should be parseable" },
305 "subtest_291": {
"assert":
"expression max-resolution: 0dpi should not be parseable" },
306 "subtest_292": {
"assert":
"expression max-resolution: -3dpi should not be parseable" },
307 "find_resolution": {},
308 "subtest_293": {
"assert":
"(resolution: 133dpi) should apply" },
309 "subtest_294": {
"assert":
"(resolution: 134dpi) should not apply" },
310 "subtest_295": {
"assert":
"(resolution: 132dpi) should not apply" },
311 "subtest_296": {
"assert":
"(min-resolution: 132dpi) should apply" },
312 "subtest_297": {
"assert":
"not all and (min-resolution: 132dpi) should not apply" },
313 "subtest_298": {
"assert":
"not all and (min-resolution: 134dpi) should apply" },
314 "subtest_299": {
"assert":
"all and (min-resolution: 134dpi) should not apply" },
315 "subtest_300": {
"assert":
"(min-resolution: 51dpcm) should apply" },
316 "subtest_301": {
"assert":
"(max-resolution: 53dpcm) should apply" },
317 "subtest_302": {
"assert":
"(max-resolution: 51dpcm) should not apply" },
318 "subtest_303": {
"assert":
"not all and (min-resolution: 53dpcm) should apply" },
319 "subtest_304": {
"assert":
"expression scan should be parseable" },
320 "subtest_305": {
"assert":
"expression scan: progressive should be parseable" },
321 "subtest_306": {
"assert":
"expression scan:interlace should be parseable" },
322 "subtest_307": {
"assert":
"expression min-scan:interlace should not be parseable" },
323 "subtest_308": {
"assert":
"expression scan: 1 should not be parseable" },
324 "subtest_309": {
"assert":
"expression max-scan should not be parseable" },
325 "subtest_310": {
"assert":
"expression max-scan: progressive should not be parseable" },
326 "subtest_311": {
"assert":
"(scan) should not apply" },
327 "subtest_312": {
"assert":
"(scan: progressive) should not apply" },
328 "subtest_313": {
"assert":
"(scan: interlace) should not apply" },
329 "subtest_314": {
"assert":
"not all and (scan) should apply" },
330 "subtest_315": {
"assert":
"not all and (scan: progressive) should apply" },
331 "subtest_316": {
"assert":
"not all and (scan: interlace) should apply" },
332 "subtest_317": {
"assert":
"expression grid should be parseable" },
333 "subtest_318": {
"assert":
"expression grid: 0 should be parseable" },
334 "subtest_319": {
"assert":
"expression grid: 1 should be parseable" },
335 "subtest_320": {
"assert":
"expression grid: 1 should be parseable" },
336 "subtest_321": {
"assert":
"expression min-grid should not be parseable" },
337 "subtest_322": {
"assert":
"expression min-grid:0 should not be parseable" },
338 "subtest_323": {
"assert":
"expression max-grid: 1 should not be parseable" },
339 "subtest_324": {
"assert":
"expression grid: 2 should not be parseable" },
340 "subtest_325": {
"assert":
"expression grid: -1 should not be parseable" },
341 "subtest_326": {
"assert":
"(grid) should not apply" },
342 "subtest_327": {
"assert":
"(grid: 0) should apply" },
343 "subtest_328": {
"assert":
"(grid: 1) should not apply" },
344 "subtest_329": {
"assert":
"(grid: 2) should not apply" },
345 "subtest_330": {
"assert":
"(grid: -1) should not apply" },
346 "subtest_331": {
"assert":
"(orientation should apply" },
347 "subtest_332": {
"assert":
"not all and (orientation should not apply" },
348 "subtest_333": {
"assert":
"(orientation: should not apply" },
349 "subtest_334": {
"assert":
"all,(orientation: should apply" },
350 "subtest_335": {
"assert":
"(orientation:,all should not apply" },
351 "subtest_336": {
"assert":
"not all and (grid should apply" },
352 "subtest_337": {
"assert":
"only all and (grid should not apply" },
353 "subtest_338": {
"assert":
"(grid should not apply" },
354 "subtest_339": {
"assert":
"all,(grid should apply" },
355 "subtest_340": {
"assert":
"(grid,all should not apply" },
356 "subtest_341": {
"assert":
",all should apply" },
357 "subtest_342": {
"assert":
"all, should apply" },
358 "subtest_343": {
"assert":
",all, should apply" },
359 "subtest_344": {
"assert":
"all,badmedium should apply" },
360 "subtest_345": {
"assert":
"badmedium,all should apply" },
361 "subtest_346": {
"assert":
",badmedium, should not apply" },
362 "subtest_347": {
"assert":
"all,(badexpression) should apply" },
363 "subtest_348": {
"assert":
"(badexpression),all should apply" },
364 "subtest_349": {
"assert":
"(badexpression),badmedium should not apply" },
365 "subtest_350": {
"assert":
"badmedium,(badexpression) should not apply" },
366 "subtest_351": {
"assert":
"all,[badsyntax] should apply" },
367 "subtest_352": {
"assert":
"[badsyntax],all should apply" },
368 "subtest_353": {
"assert":
"badmedium,[badsyntax] should not apply" },
369 "subtest_354": {
"assert":
"[badsyntax],badmedium should not apply" },
370 "subtest_355": {
"assert":
"query all and color : should not be parseable" },
371 "subtest_356": {
"assert":
"query all and color : 1 should not be parseable" },
372 "subtest_357": {
"assert":
"all and min-color : 1 should not apply" },
373 "subtest_358": {
"assert":
"(bogus) should not apply" },
374 "subtest_359": {
"assert":
"not all and (bogus) should not apply" },
375 "subtest_360": {
"assert":
"only all and (bogus) should not apply" }
379 <body onload=
"run()">
381 <iframe id=
"subdoc" src=
"resources/media_queries_iframe.html"></iframe>
382 <div id=
"content" style=
"display: none"></div>
384 <script type=
"text/javascript">
385 setup({ "explicit_done": true });
388 var subdoc
= document
.getElementById("subdoc").contentDocument
;
389 var subwin
= document
.getElementById("subdoc").contentWindow
;
390 var style
= subdoc
.getElementById("style");
391 var iframe_style
= document
.getElementById("subdoc").style
;
392 var body_cs
= subdoc
.defaultView
.getComputedStyle(subdoc
.body
, "");
395 function query_applies(q
) {
396 style
.setAttribute("media", q
);
397 return body_cs
.getPropertyValue("text-decoration") == "underline solid rgb(0, 0, 0)";
400 function should_apply(q
) {
402 assert_true(query_applies(q
));
403 }, "subtest_" + ++testNum
, {assert
: q
+ " should apply"});
406 function should_not_apply(q
) {
408 assert_false(query_applies(q
));
409 }, "subtest_" + ++testNum
, {assert
: q
+ " should not apply"});
413 * Functions to test whether a query is parseable at all. (Should not
414 * be used for parse errors within expressions.)
416 var parse_test_style_element
= document
.createElement("style");
417 parse_test_style_element
.type
= "text/css";
418 parse_test_style_element
.disabled
= true; // for performance, hopefully
419 var parse_test_style_text
= document
.createTextNode("");
420 parse_test_style_element
.appendChild(parse_test_style_text
);
421 document
.getElementsByTagName("head")[0]
422 .appendChild(parse_test_style_element
);
424 function query_is_parseable(q
) {
425 parse_test_style_text
.data
= "@media screen, " + q
+ " {}";
426 var sheet
= parse_test_style_element
.sheet
; // XXX yikes, not live!
427 if (sheet
.cssRules
.length
== 1 &&
428 sheet
.cssRules
[0].type
== CSSRule
.MEDIA_RULE
)
429 return sheet
.cssRules
[0].media
.mediaText
!= "screen, not all";
432 "unexpected result testing whether query " + q
+ " is parseable");
435 function query_should_be_parseable(q
) {
437 assert_true(query_is_parseable(q
))
438 }, "subtest_" + ++testNum
, {assert
: "query " + q
+ " should be parseable"});
441 function query_should_not_be_parseable(q
) {
443 assert_false(query_is_parseable(q
))
444 }, "subtest_" + ++testNum
, {assert
: "query " + q
+ " should not be parseable"});
448 * Functions to test whether a single media expression is parseable.
450 function expression_is_parseable(e
) {
451 style
.setAttribute("media", "all and (" + e
+ ")");
452 return style
.sheet
.media
.mediaText
!= "not all";
455 function expression_should_be_parseable(e
) {
457 assert_true(expression_is_parseable(e
));
458 }, "subtest_" + ++testNum
, {assert
: "expression " + e
+ " should be parseable"});
461 function expression_should_not_be_parseable(e
) {
463 assert_false(expression_is_parseable(e
));
464 }, "subtest_" + ++testNum
, {assert
: "expression " + e
+ " should not be parseable"});
467 // The no-type syntax doesn't mix with the not and only keywords.
468 query_should_be_parseable("(orientation)");
469 query_should_not_be_parseable("not (orientation)");
470 query_should_not_be_parseable("only (orientation)");
471 query_should_be_parseable("all and (orientation)");
472 query_should_be_parseable("not all and (orientation)");
473 query_should_be_parseable("only all and (orientation)");
475 var features
= [ "width", "height", "device-width", "device-height" ];
478 for (i
in features
) {
479 feature
= features
[i
];
480 expression_should_be_parseable(feature
);
481 expression_should_be_parseable(feature
+ ": 0");
482 expression_should_be_parseable(feature
+ ": 0px");
483 expression_should_be_parseable(feature
+ ": 0em");
484 expression_should_be_parseable(feature
+ ": -0");
485 expression_should_be_parseable("min-" + feature
+ ": -0");
486 expression_should_be_parseable("max-" + feature
+ ": -0");
487 expression_should_be_parseable(feature
+ ": -0cm");
488 expression_should_be_parseable(feature
+ ": 1px");
489 expression_should_be_parseable(feature
+ ": 0.001mm");
490 expression_should_be_parseable(feature
+ ": 100000px");
491 expression_should_not_be_parseable(feature
+ ": -1px");
492 expression_should_not_be_parseable("min-" + feature
+ ": -1px");
493 expression_should_not_be_parseable("max-" + feature
+ ": -1px");
494 expression_should_not_be_parseable(feature
+ ": -0.00001mm");
495 expression_should_not_be_parseable(feature
+ ": -100000em");
496 expression_should_not_be_parseable("min-" + feature
);
497 expression_should_not_be_parseable("max-" + feature
);
500 var content_div
= document
.getElementById("content");
501 content_div
.style
.font
= "medium sans-serif";
503 getComputedStyle(content_div
, "").fontSize
.match(/^(\d+)px$/)[1];
505 // in this test, assume the common underlying implementation is correct
506 var width_val
= 117; // pick two not-too-round numbers
508 iframe_style
.width
= width_val
+ "px";
509 iframe_style
.height
= height_val
+ "px";
510 var device_width
= window
.screen
.width
;
511 var device_height
= window
.screen
.height
;
512 features
= { "width": width_val
,
513 "height": height_val
,
514 "device-width": device_width
,
515 "device-height": device_height
};
516 for (feature
in features
) {
517 var value
= features
[feature
];
518 should_apply("all and (" + feature
+ ": " + value
+ "px)");
519 should_not_apply("all and (" + feature
+ ": " + (value
+ 1) + "px)");
520 should_not_apply("all and (" + feature
+ ": " + (value
- 1) + "px)");
521 should_apply("all and (min-" + feature
+ ": " + value
+ "px)");
522 should_not_apply("all and (min-" + feature
+ ": " + (value
+ 1) + "px)");
523 should_apply("all and (min-" + feature
+ ": " + (value
- 1) + "px)");
524 should_apply("all and (max-" + feature
+ ": " + value
+ "px)");
525 should_apply("all and (max-" + feature
+ ": " + (value
+ 1) + "px)");
526 should_not_apply("all and (max-" + feature
+ ": " + (value
- 1) + "px)");
527 should_not_apply("all and (min-" + feature
+ ": " +
528 (Math
.ceil(value
/em_size
) + 1) + "em)");
529 should_apply("all and (min-" + feature
+ ": " +
530 (Math
.floor(value
/em_size
) - 1) + "em)");
531 should_apply("all and (max-" + feature
+ ": " +
532 (Math
.ceil(value
/em_size
) + 1) + "em)");
533 should_not_apply("all and (max-" + feature
+ ": " +
534 (Math
.floor(value
/em_size
) - 1) + "em)");
537 iframe_style
.width
= "0";
538 should_apply("all and (height)");
539 should_not_apply("all and (width)");
540 iframe_style
.height
= "0";
541 should_not_apply("all and (height)");
542 should_not_apply("all and (width)");
543 should_apply("all and (device-height)");
544 should_apply("all and (device-width)");
545 iframe_style
.width
= width_val
+ "px";
546 should_not_apply("all and (height)");
547 should_apply("all and (width)");
548 iframe_style
.height
= height_val
+ "px";
549 should_apply("all and (height)");
550 should_apply("all and (width)");
552 // ratio that reduces to 59/40
553 iframe_style
.width
= "236px";
554 iframe_style
.height
= "160px";
555 expression_should_be_parseable("orientation");
556 expression_should_be_parseable("orientation: portrait");
557 expression_should_be_parseable("orientation: landscape");
558 expression_should_not_be_parseable("min-orientation");
559 expression_should_not_be_parseable("min-orientation: portrait");
560 expression_should_not_be_parseable("min-orientation: landscape");
561 expression_should_not_be_parseable("max-orientation");
562 expression_should_not_be_parseable("max-orientation: portrait");
563 expression_should_not_be_parseable("max-orientation: landscape");
564 should_apply("(orientation)");
565 should_apply("(orientation: landscape)");
566 should_not_apply("(orientation: portrait)");
567 should_apply("not all and (orientation: portrait)");
568 // ratio that reduces to 59/80
569 iframe_style
.height
= "320px";
570 should_apply("(orientation)");
571 should_not_apply("(orientation: landscape)");
572 should_apply("not all and (orientation: landscape)");
573 should_apply("(orientation: portrait)");
575 should_apply("(aspect-ratio: 59/80)");
576 should_not_apply("(aspect-ratio: 58/80)");
577 should_not_apply("(aspect-ratio: 59/81)");
578 should_not_apply("(aspect-ratio: 60/80)");
579 should_not_apply("(aspect-ratio: 59/79)");
580 should_apply("(aspect-ratio: 177/240)");
581 should_apply("(aspect-ratio: 413/560)");
582 should_apply("(aspect-ratio: 5900/8000)");
583 should_not_apply("(aspect-ratio: 5901/8000)");
584 should_not_apply("(aspect-ratio: 5899/8000)");
585 should_not_apply("(aspect-ratio: 5900/8001)");
586 should_not_apply("(aspect-ratio: 5900/7999)");
587 should_apply("(aspect-ratio)");
589 should_apply("(min-aspect-ratio: 59/80)");
590 should_apply("(min-aspect-ratio: 58/80)");
591 should_apply("(min-aspect-ratio: 59/81)");
592 should_not_apply("(min-aspect-ratio: 60/80)");
593 should_not_apply("(min-aspect-ratio: 59/79)");
594 expression_should_not_be_parseable("min-aspect-ratio");
596 should_apply("(max-aspect-ratio: 59/80)");
597 should_not_apply("(max-aspect-ratio: 58/80)");
598 should_not_apply("(max-aspect-ratio: 59/81)");
599 should_apply("(max-aspect-ratio: 60/80)");
600 should_apply("(max-aspect-ratio: 59/79)");
601 expression_should_not_be_parseable("max-aspect-ratio");
603 var real_dar
= device_width
+ "/" + device_height
;
604 var high_dar_1
= (device_width
+ 1) + "/" + device_height
;
605 var high_dar_2
= device_width
+ "/" + (device_height
- 1);
606 var low_dar_1
= (device_width
- 1) + "/" + device_height
;
607 var low_dar_2
= device_width
+ "/" + (device_height
+ 1);
608 should_apply("(device-aspect-ratio: " + real_dar
+ ")");
609 should_apply("not all and (device-aspect-ratio: " + high_dar_1
+ ")");
610 should_not_apply("all and (device-aspect-ratio: " + high_dar_2
+ ")");
611 should_not_apply("all and (device-aspect-ratio: " + low_dar_1
+ ")");
612 should_apply("not all and (device-aspect-ratio: " + low_dar_2
+ ")");
613 should_apply("(device-aspect-ratio)");
615 should_apply("(min-device-aspect-ratio: " + real_dar
+ ")");
616 should_not_apply("all and (min-device-aspect-ratio: " + high_dar_1
+ ")");
617 should_apply("not all and (min-device-aspect-ratio: " + high_dar_2
+ ")");
618 should_not_apply("not all and (min-device-aspect-ratio: " + low_dar_1
+ ")");
619 should_apply("all and (min-device-aspect-ratio: " + low_dar_2
+ ")");
620 expression_should_not_be_parseable("min-device-aspect-ratio");
622 should_apply("all and (max-device-aspect-ratio: " + real_dar
+ ")");
623 should_apply("(max-device-aspect-ratio: " + high_dar_1
+ ")");
624 should_apply("(max-device-aspect-ratio: " + high_dar_2
+ ")");
625 should_not_apply("all and (max-device-aspect-ratio: " + low_dar_1
+ ")");
626 should_apply("not all and (max-device-aspect-ratio: " + low_dar_2
+ ")");
627 expression_should_not_be_parseable("max-device-aspect-ratio");
629 features
= [ "max-aspect-ratio", "device-aspect-ratio" ];
630 for (i
in features
) {
631 feature
= features
[i
];
632 expression_should_be_parseable(feature
+ ": 1/1");
633 expression_should_be_parseable(feature
+ ": 1 /1");
634 expression_should_be_parseable(feature
+ ": 1 / \t\n1");
635 expression_should_be_parseable(feature
+ ": 1/\r1");
636 expression_should_not_be_parseable(feature
+ ": 1");
637 expression_should_not_be_parseable(feature
+ ": 0.5");
638 expression_should_not_be_parseable(feature
+ ": 1.0/1");
639 expression_should_not_be_parseable(feature
+ ": 1/1.0");
640 expression_should_not_be_parseable(feature
+ ": 1.0/1.0");
641 expression_should_not_be_parseable(feature
+ ": 0/1");
642 expression_should_not_be_parseable(feature
+ ": 1/0");
643 expression_should_not_be_parseable(feature
+ ": 0/0");
644 expression_should_not_be_parseable(feature
+ ": -1/1");
645 expression_should_not_be_parseable(feature
+ ": 1/-1");
646 expression_should_not_be_parseable(feature
+ ": -1/-1");
649 var is_monochrome
= query_applies("all and (min-monochrome: 1)");
650 var is_color
= query_applies("all and (min-color: 1)");
652 assert_not_equals(is_monochrome
, is_color
, "should be either monochrome or color");
653 }, "monochrome_and_color");
655 function depth_query(prefix
, depth
) {
656 return "all and (" + prefix
+ (is_color
? "color" : "monochrome") +
665 } while (query_applies(depth_query("min-", ++depth
)));
667 assert_false(50 < depth
);
671 should_apply(depth_query("", depth
));
672 should_not_apply(depth_query("", depth
- 1));
673 should_not_apply(depth_query("", depth
+ 1));
674 should_apply(depth_query("max-", depth
));
675 should_not_apply(depth_query("max-", depth
- 1));
676 should_apply(depth_query("max-", depth
+ 1));
678 (is_color
? should_apply
: should_not_apply
)("all and (color)");
679 expression_should_not_be_parseable("max-color");
680 expression_should_not_be_parseable("min-color");
681 (is_color
? should_not_apply
: should_apply
)("all and (monochrome)");
682 expression_should_not_be_parseable("max-monochrome");
683 expression_should_not_be_parseable("min-monochrome");
684 (is_color
? should_apply
: should_not_apply
)("not all and (monochrome)");
685 (is_color
? should_not_apply
: should_apply
)("not all and (color)");
686 (is_color
? should_apply
: should_not_apply
)("only all and (color)");
687 (is_color
? should_not_apply
: should_apply
)("only all and (monochrome)");
689 features
= [ "color", "min-monochrome", "max-color-index" ];
690 for (i
in features
) {
691 feature
= features
[i
];
692 expression_should_be_parseable(feature
+ ": 1");
693 expression_should_be_parseable(feature
+ ": 327");
694 expression_should_be_parseable(feature
+ ": 0");
695 expression_should_not_be_parseable(feature
+ ": 1.0");
696 expression_should_not_be_parseable(feature
+ ": -1");
697 expression_should_not_be_parseable(feature
+ ": 1/1");
700 // Presume that we never support indexed color (at least not usefully
701 // enough to call it indexed color).
702 should_apply("(color-index: 0)");
703 should_not_apply("(color-index: 1)");
704 should_apply("(min-color-index: 0)");
705 should_not_apply("(min-color-index: 1)");
706 should_apply("(max-color-index: 0)");
707 should_apply("(max-color-index: 1)");
708 should_apply("(max-color-index: 157)");
710 features
= [ "resolution", "min-resolution", "max-resolution" ];
711 for (i
in features
) {
712 feature
= features
[i
];
713 expression_should_be_parseable(feature
+ ": 3dpi");
714 expression_should_be_parseable(feature
+ ":3dpi");
715 expression_should_be_parseable(feature
+ ": 3.0dpi");
716 expression_should_be_parseable(feature
+ ": 3.4dpi");
717 expression_should_be_parseable(feature
+ "\t: 120dpcm");
718 expression_should_not_be_parseable(feature
+ ": 0dpi");
719 expression_should_not_be_parseable(feature
+ ": -3dpi");
722 // Find the resolution using max-resolution
726 if (resolution
> 10000) {
729 } while (!query_applies("(max-resolution: " + resolution
+ "dpi)"));
731 assert_false(10000 < resolution
);
732 }, "find_resolution");
734 // resolution should now be Math.ceil() of the actual resolution.
736 var dpi_low
= resolution
- 1;
737 if (query_applies("(min-resolution: " + resolution
+ "dpi)")) {
739 should_apply("(resolution: " + resolution
+ "dpi)");
740 should_not_apply("(resolution: " + (resolution
+ 1) + "dpi)");
741 should_not_apply("(resolution: " + (resolution
- 1) + "dpi)");
742 dpi_high
= resolution
+ 1;
744 // We have no way to test resolution applying since it need not be
746 should_not_apply("(resolution: " + resolution
+ "dpi)");
747 should_not_apply("(resolution: " + (resolution
- 1) + "dpi)");
748 dpi_high
= resolution
;
751 should_apply("(min-resolution: " + dpi_low
+ "dpi)");
752 should_not_apply("not all and (min-resolution: " + dpi_low
+ "dpi)");
753 should_apply("not all and (min-resolution: " + dpi_high
+ "dpi)");
754 should_not_apply("all and (min-resolution: " + dpi_high
+ "dpi)");
756 // Test dpcm units based on what we computed in dpi.
757 var dpcm_high
= Math
.ceil(dpi_high
/ 2.54);
758 var dpcm_low
= Math
.floor(dpi_low
/ 2.54);
759 should_apply("(min-resolution: " + dpcm_low
+ "dpcm)");
760 should_apply("(max-resolution: " + dpcm_high
+ "dpcm)");
761 should_not_apply("(max-resolution: " + dpcm_low
+ "dpcm)");
762 should_apply("not all and (min-resolution: " + dpcm_high
+ "dpcm)");
764 expression_should_be_parseable("scan");
765 expression_should_be_parseable("scan: progressive");
766 expression_should_be_parseable("scan:interlace");
767 expression_should_not_be_parseable("min-scan:interlace");
768 expression_should_not_be_parseable("scan: 1");
769 expression_should_not_be_parseable("max-scan");
770 expression_should_not_be_parseable("max-scan: progressive");
771 // Assume we don't support tv devices.
772 should_not_apply("(scan)");
773 should_not_apply("(scan: progressive)");
774 should_not_apply("(scan: interlace)");
775 should_apply("not all and (scan)");
776 should_apply("not all and (scan: progressive)");
777 should_apply("not all and (scan: interlace)");
779 expression_should_be_parseable("grid");
780 expression_should_be_parseable("grid: 0");
781 expression_should_be_parseable("grid: 1");
782 expression_should_be_parseable("grid: 1");
783 expression_should_not_be_parseable("min-grid");
784 expression_should_not_be_parseable("min-grid:0");
785 expression_should_not_be_parseable("max-grid: 1");
786 expression_should_not_be_parseable("grid: 2");
787 expression_should_not_be_parseable("grid: -1");
789 // Assume we don't support grid devices
790 should_not_apply("(grid)");
791 should_apply("(grid: 0)");
792 should_not_apply("(grid: 1)");
793 should_not_apply("(grid: 2)");
794 should_not_apply("(grid: -1)");
798 should_apply("(orientation");
799 should_not_apply("not all and (orientation");
800 should_not_apply("(orientation:");
801 should_apply("all,(orientation:");
802 should_not_apply("(orientation:,all");
803 should_apply("not all and (grid");
804 should_not_apply("only all and (grid");
805 should_not_apply("(grid");
806 should_apply("all,(grid");
807 should_not_apply("(grid,all");
809 should_apply(",all");
810 should_apply("all,");
811 should_apply(",all,");
812 should_apply("all,badmedium");
813 should_apply("badmedium,all");
814 should_not_apply(",badmedium,");
815 should_apply("all,(badexpression)");
816 should_apply("(badexpression),all");
817 should_not_apply("(badexpression),badmedium");
818 should_not_apply("badmedium,(badexpression)");
819 should_apply("all,[badsyntax]");
820 should_apply("[badsyntax],all");
821 should_not_apply("badmedium,[badsyntax]");
822 should_not_apply("[badsyntax],badmedium");
824 // Parsing tests based on Acid3
825 query_should_not_be_parseable("all and color :");
826 query_should_not_be_parseable("all and color : 1");
827 should_not_apply("all and min-color : 1");
828 should_not_apply("(bogus)");
829 should_not_apply("not all and (bogus)")
830 should_not_apply("only all and (bogus)")