Regression(r188105): Seems to have caused crashes during PLT on some iPads
[WebKit-https.git] / LayoutTests / fast / css / css-set-selector-text.html
1 <html>
2 <head id="head">
3 <script src="../../resources/js-test-pre.js"></script>
4 </head>
5 <body>
6 <script>
7
8 description("This tests setting and re-serialization of some CSS selectors.");
9
10 var bogusSelector = "_foo";
11
12 function setThenReadSelectorText(selector)
13 {
14     var styleElement = document.getElementById("style");
15     var head = document.getElementById("head");
16     if (styleElement)
17         head.removeChild(styleElement);
18
19     styleElement = document.createElement("style");
20     styleElement.id = "style";
21     var head = document.getElementById("head");
22     head.appendChild(styleElement);
23
24     // First, create a rule with a bogus selector.
25     styleElement.appendChild(document.createTextNode(bogusSelector + " { }"));
26     // Now, set the desired selector text.
27     styleElement.sheet.cssRules[0].selectorText = selector;
28     return styleElement.sheet.cssRules[0].selectorText;
29 }
30
31 function expectedSerializedLangSelector(selector)
32 {
33     var args = /:lang\(([^)]+)/.exec(selector);
34     if (!args || !args[1])
35         return selector;
36
37     args = args[1].split(/\s*,\s*/);
38     var expected = ':lang(';
39     for (var i = 0; i < args.length; ++i) {
40         var arg = args[i];
41         var hasQuotes = arg.indexOf('"') == 0 && arg.lastIndexOf('"') == arg.length - 1;
42         if (!hasQuotes)
43             expected += '"';
44         expected += args[i];
45         if (!hasQuotes)
46             expected += '"';
47         if (i < args.length - 1)
48             expected += ', ';
49     }
50     expected += ')';
51     return expected;
52 }
53
54 function testSelectorRoundTrip(selector, expectFailure)
55 {
56     var expected = selector.indexOf(":lang") == 0 ? expectedSerializedLangSelector(selector) : selector;
57     shouldBe("setThenReadSelectorText('" + selector + "')", "'" + (expectFailure ? bogusSelector : expected) + "'");
58 }
59
60 testSelectorRoundTrip('', true);
61 testSelectorRoundTrip('123', true);
62 testSelectorRoundTrip('-', true);
63 testSelectorRoundTrip('$', true);
64 testSelectorRoundTrip(':', true);
65 testSelectorRoundTrip('.', true);
66 testSelectorRoundTrip('#', true);
67 testSelectorRoundTrip('[]', true);
68 testSelectorRoundTrip('()', true);
69
70 debug('');
71
72 testSelectorRoundTrip('*');
73 testSelectorRoundTrip('a');
74 testSelectorRoundTrip('#a');
75 testSelectorRoundTrip('.a');
76 testSelectorRoundTrip(':active');
77 testSelectorRoundTrip('[a]');
78 testSelectorRoundTrip('[a="b"]');
79 testSelectorRoundTrip('[a~="b"]');
80 testSelectorRoundTrip('[a|="b"]');
81 testSelectorRoundTrip('[a^="b"]');
82 testSelectorRoundTrip('[a$="b"]');
83 testSelectorRoundTrip('[a*="b"]');
84 testSelectorRoundTrip('[a="b" i]');
85 testSelectorRoundTrip('[a~="b" i]');
86 testSelectorRoundTrip('[a|="b" i]');
87 testSelectorRoundTrip('[a^="b" i]');
88 testSelectorRoundTrip('[a$="b" i]');
89 testSelectorRoundTrip('[a*="b" i]');
90
91 debug('');
92
93 testSelectorRoundTrip('*|a');
94 testSelectorRoundTrip('n|a');
95 testSelectorRoundTrip('*|*');
96 testSelectorRoundTrip('n|*');
97 testSelectorRoundTrip('[*|a]');
98 testSelectorRoundTrip('[n|a]');
99
100 debug('');
101
102 testSelectorRoundTrip('a:active');
103 testSelectorRoundTrip('a b');
104 testSelectorRoundTrip('a >> b');
105 testSelectorRoundTrip('a + b');
106 testSelectorRoundTrip('a ~ b');
107 testSelectorRoundTrip('a > b');
108
109 debug('');
110
111 testSelectorRoundTrip(":active");
112 testSelectorRoundTrip(":any-link");
113 testSelectorRoundTrip(":checked");
114 testSelectorRoundTrip(":disabled");
115 testSelectorRoundTrip(":empty");
116 testSelectorRoundTrip(":enabled");
117 testSelectorRoundTrip(":first-child");
118 testSelectorRoundTrip(":first-of-type");
119 testSelectorRoundTrip(":focus");
120 testSelectorRoundTrip(":hover");
121 testSelectorRoundTrip(":indeterminate");
122 testSelectorRoundTrip(":link");
123 testSelectorRoundTrip(":not(:placeholder-shown)");
124 testSelectorRoundTrip(":placeholder-shown");
125 testSelectorRoundTrip(":root");
126 testSelectorRoundTrip(":target");
127 testSelectorRoundTrip(":visited");
128
129 debug('');
130
131 testSelectorRoundTrip(":dir(a)");
132 testSelectorRoundTrip(":lang(\"a\")");
133 testSelectorRoundTrip(":lang(a)");
134 testSelectorRoundTrip(":not(a)");
135 testSelectorRoundTrip(":role(a)");
136 testSelectorRoundTrip(":-webkit-any(a, b, p)");
137
138 debug('');
139
140 testSelectorRoundTrip("::after");
141 testSelectorRoundTrip("::before");
142 testSelectorRoundTrip("::first-letter");
143 testSelectorRoundTrip("::first-line");
144 testSelectorRoundTrip("::selection");
145
146 debug('');
147
148 testSelectorRoundTrip(":-webkit-any-link");
149 testSelectorRoundTrip(":-webkit-autofill");
150 testSelectorRoundTrip(":-webkit-drag");
151
152 testSelectorRoundTrip('a:any-link');
153 testSelectorRoundTrip('a :any-link');
154 testSelectorRoundTrip('div:any-link');
155 testSelectorRoundTrip('div :any-link');
156 testSelectorRoundTrip(':any-link > div');
157 testSelectorRoundTrip(':any-link + div');
158 testSelectorRoundTrip(':not(:any-link)');
159
160 debug('');
161
162 testSelectorRoundTrip(":nth-child(odd)");
163 testSelectorRoundTrip(":nth-child(even)");
164 testSelectorRoundTrip(":nth-child(n)");
165 testSelectorRoundTrip(":nth-child(-n)");
166 testSelectorRoundTrip(":nth-child(5)");
167 testSelectorRoundTrip(":nth-child(-5)");
168 testSelectorRoundTrip(":nth-child(5n+7)");
169 testSelectorRoundTrip(":nth-child(-5n+7)");
170 testSelectorRoundTrip(":nth-child(5n-7)");
171 testSelectorRoundTrip(":nth-child(-5n-7)");
172
173 debug('');
174
175 testSelectorRoundTrip(":nth-child(odd of .foo, :nth-child(odd))");
176 testSelectorRoundTrip(":nth-child(even of .foo, :nth-child(odd))");
177 testSelectorRoundTrip(":nth-child(n of .foo, :nth-child(odd))");
178 testSelectorRoundTrip(":nth-child(-n of .foo, :nth-child(odd))");
179 testSelectorRoundTrip(":nth-child(5 of .foo, :nth-child(odd))");
180 testSelectorRoundTrip(":nth-child(-5 of .foo, :nth-child(odd))");
181 testSelectorRoundTrip(":nth-child(5n+7 of .foo, :nth-child(odd))");
182 testSelectorRoundTrip(":nth-child(-5n+7 of .foo, :nth-child(odd))");
183 testSelectorRoundTrip(":nth-child(5n-7 of .foo, :nth-child(odd))");
184 testSelectorRoundTrip(":nth-child(-5n-7 of .foo, :nth-child(odd))");
185
186 debug('');
187
188 testSelectorRoundTrip(":nth-last-child(odd of .foo, :nth-last-child(odd))");
189 testSelectorRoundTrip(":nth-last-child(even of .foo, :nth-last-child(odd))");
190 testSelectorRoundTrip(":nth-last-child(n of .foo, :nth-last-child(odd))");
191 testSelectorRoundTrip(":nth-last-child(-n of .foo, :nth-last-child(odd))");
192 testSelectorRoundTrip(":nth-last-child(5 of .foo, :nth-last-child(odd))");
193 testSelectorRoundTrip(":nth-last-child(-5 of .foo, :nth-last-child(odd))");
194 testSelectorRoundTrip(":nth-last-child(5n+7 of .foo, :nth-last-child(odd))");
195 testSelectorRoundTrip(":nth-last-child(-5n+7 of .foo, :nth-last-child(odd))");
196 testSelectorRoundTrip(":nth-last-child(5n-7 of .foo, :nth-last-child(odd))");
197 testSelectorRoundTrip(":nth-last-child(-5n-7 of .foo, :nth-last-child(odd))");
198
199 debug('');
200
201 testSelectorRoundTrip(':matches(single)');
202 testSelectorRoundTrip(':matches(a, b, p)');
203 testSelectorRoundTrip(':matches(#alice, #bob, #chris)');
204 testSelectorRoundTrip(':matches(.selector, #tama, #hanayo, #midoriko)');
205 testSelectorRoundTrip(':matches(.name, #ok, :visited)');
206 testSelectorRoundTrip(':matches(.name, #ok, :visited, :link)');
207 testSelectorRoundTrip(':matches(.name, #ok, :matches(:visited))');
208 testSelectorRoundTrip(':matches(.name, #ok, :not(:link))');
209 testSelectorRoundTrip(':matches(.name, #ok, :not(:link))');
210 testSelectorRoundTrip(':matches(.name, #ok, :-webkit-any(hello))');
211 testSelectorRoundTrip(':matches(.name, #ok, :-webkit-any(.selector, #tama, #hanayo, #midoriko))');
212 testSelectorRoundTrip(':matches([type="file"])');
213 testSelectorRoundTrip(':matches(:hover)');
214 testSelectorRoundTrip('input:matches([type="file"], :hover, :focus):enabled');
215 testSelectorRoundTrip(':matches(input[type="file"], a:hover, button:focus)');
216 testSelectorRoundTrip(':matches(.class1.class2.class3)');
217 testSelectorRoundTrip(':matches(.class1:hover)');
218 testSelectorRoundTrip(':matches(a.class1.class2.class3:hover)');
219 testSelectorRoundTrip(':matches(::first-letter, ::first-line)');
220 testSelectorRoundTrip(':matches(a > ::first-letter, b ~ ::first-line, c ::after, d + ::before)');
221 testSelectorRoundTrip(':matches(.ok a > ::first-letter, .ok b ~ ::first-line, .ok c ::after, .ok d + ::before)');
222 testSelectorRoundTrip(':matches(.ok a > .ok ::first-letter, .ok b ~ .ok ::first-line, .ok c .ok ::after, .ok d + .ok ::before)');
223 testSelectorRoundTrip(':-webkit-any(:matches(single))');
224 testSelectorRoundTrip(':-webkit-any(:matches(a, b, p))');
225 testSelectorRoundTrip(':-webkit-any(:matches(#alice, #bob, #chris))');
226 testSelectorRoundTrip(':-webkit-any(:matches(.selector, #tama, #hanayo, #midoriko))');
227 testSelectorRoundTrip(':-webkit-any(:matches(.name, #ok, :visited))');
228 testSelectorRoundTrip(':-webkit-any(:matches(.name, #ok, :visited, :link))');
229 testSelectorRoundTrip(':-webkit-any(:matches(.name, #ok, :matches(:visited)))');
230 testSelectorRoundTrip(':-webkit-any(:matches(.name, #ok, :not(:link)))');
231 testSelectorRoundTrip(':-webkit-any(:matches(.name, #ok, :not(:link)))');
232 testSelectorRoundTrip(':-webkit-any(:matches(.name, #ok, :-webkit-any(hello)))');
233 testSelectorRoundTrip(':-webkit-any(:matches(.name, #ok, :-webkit-any(.selector, #tama, #hanayo, #midoriko)))');
234 testSelectorRoundTrip(':-webkit-any(:matches([type="file"]))');
235 testSelectorRoundTrip(':-webkit-any(:matches(:hover))');
236 testSelectorRoundTrip(':-webkit-any(input:matches([type="file"], :hover, :focus):enabled)');
237 testSelectorRoundTrip(':-webkit-any(:matches(input[type="file"], a:hover, button:focus))');
238 testSelectorRoundTrip(':-webkit-any(:matches(.class1.class2.class3))');
239 testSelectorRoundTrip(':-webkit-any(:matches(.class1:hover))');
240 testSelectorRoundTrip(':-webkit-any(:matches(a.class1.class2.class3:hover))');
241 testSelectorRoundTrip(':-webkit-any(:matches(::first-letter, ::first-line))');
242 testSelectorRoundTrip(':-webkit-any(:matches(a > ::first-letter, b ~ ::first-line, c ::after, d + ::before))');
243 testSelectorRoundTrip(':-webkit-any(:matches(.ok a > ::first-letter, .ok b ~ ::first-line, .ok c ::after, .ok d + ::before))');
244 testSelectorRoundTrip(':-webkit-any(:matches(.ok a > .ok ::first-letter, .ok b ~ .ok ::first-line, .ok c .ok ::after, .ok d + .ok ::before))');
245
246 debug('');
247
248 testSelectorRoundTrip(':not(div)');
249 testSelectorRoundTrip(':not(.div)');
250 testSelectorRoundTrip(':not(#div)');
251 testSelectorRoundTrip(':not([div])');
252 testSelectorRoundTrip(':not(:empty)');
253 testSelectorRoundTrip(':not(div.div#div[div]:empty)');
254 testSelectorRoundTrip(':not(div.div:empty[div]#div)');
255 testSelectorRoundTrip(':not(div.div, #div[div], :empty)');
256 testSelectorRoundTrip(':not(div, .div, #div, [div], :empty)');
257
258 testSelectorRoundTrip(':not(:not(div))');
259 testSelectorRoundTrip(':not(:not(div)):not(:not(foo)):not(:not(bar))');
260 testSelectorRoundTrip(':not(:not(div, :not(foo, bar))):not(:not(foo)):not(:not(bar, baz))');
261
262 testSelectorRoundTrip(':not(:matches(*))');
263 testSelectorRoundTrip(':not(:matches(foo, bar))');
264 testSelectorRoundTrip(':not(:matches(foo, bar), :matches(.foo, .bar), :matches(#foo, #bar), :matches([foo], [bar]))');
265 testSelectorRoundTrip(':not(:matches(foo, bar:not(:empty)), :matches(.foo, .bar:not(:not(.mosaic))), :matches(#foo, #bar), :matches([foo], [bar]))');
266
267 testSelectorRoundTrip(':nth-child(2n of :not(a.b, c#d.e))');
268 testSelectorRoundTrip(':not(:nth-child(2n of :not(a.b, c#d.e)))');
269
270 testSelectorRoundTrip(':not(a .b, #c > [d], e + f:empty, .g ~ #h:first-child)');
271 testSelectorRoundTrip('a:not(a .b, #c > [d], e + f:empty, .g ~ #h:first-child) b + c:not(a .b, #c > [d], e + f:empty, .g ~ #h:first-child) ~ d:not(a .b, #c > [d], e + f:empty, .g ~ #h:first-child) > d:not(a .b, #c > [d], e + f:empty, .g ~ #h:first-child)');
272
273 debug('');
274
275 shouldBe("setThenReadSelectorText('::-webkit-file-upload-button')", "'*::-webkit-file-upload-button'");
276 shouldBe("setThenReadSelectorText('::-webkit-search-cancel-button')", "'*::-webkit-search-cancel-button'");
277 shouldBe("setThenReadSelectorText('::-webkit-search-decoration')", "'*::-webkit-search-decoration'");
278 shouldBe("setThenReadSelectorText('::-webkit-search-results-button')", "'*::-webkit-search-results-button'");
279 shouldBe("setThenReadSelectorText('::-webkit-search-results-decoration')", "'*::-webkit-search-results-decoration'");
280 shouldBe("setThenReadSelectorText('::-webkit-slider-thumb')", "'*::-webkit-slider-thumb'");
281
282 debug('');
283
284 testSelectorRoundTrip("a::-webkit-slider-thumb");
285 shouldBe("setThenReadSelectorText('a ::-webkit-slider-thumb')", "'a *::-webkit-slider-thumb'");
286 testSelectorRoundTrip("[a]::-webkit-slider-thumb");
287 shouldBe("setThenReadSelectorText('[a] ::-webkit-slider-thumb')", "'[a] *::-webkit-slider-thumb'");
288 testSelectorRoundTrip(".a::-webkit-slider-thumb");
289 shouldBe("setThenReadSelectorText('.a ::-webkit-slider-thumb')", "'.a *::-webkit-slider-thumb'");
290 testSelectorRoundTrip("#a::-webkit-slider-thumb");
291 shouldBe("setThenReadSelectorText('#a ::-webkit-slider-thumb')", "'#a *::-webkit-slider-thumb'");
292 shouldBe("setThenReadSelectorText('* ::-webkit-slider-thumb')", "'* *::-webkit-slider-thumb'");
293
294 debug('');
295
296 testSelectorRoundTrip("a[b]::-webkit-slider-thumb");
297 testSelectorRoundTrip("a.b::-webkit-slider-thumb");
298 testSelectorRoundTrip("a#b::-webkit-slider-thumb");
299 testSelectorRoundTrip("a[b].c#d::-webkit-slider-thumb");
300
301 debug('');
302
303 testSelectorRoundTrip('input:not([type="file"]):focus');
304 testSelectorRoundTrip(':-webkit-any([type="file"])');
305 testSelectorRoundTrip(':-webkit-any(:hover)');
306 testSelectorRoundTrip('input:-webkit-any([type="file"], :hover, :focus):enabled');
307 testSelectorRoundTrip(':-webkit-any(input[type="file"], a:hover, button:focus)');
308 testSelectorRoundTrip(':-webkit-any(.class1.class2.class3)');
309 testSelectorRoundTrip(':-webkit-any(.class1:hover)');
310 testSelectorRoundTrip(':-webkit-any(a.class1.class2.class3:hover)');
311
312 debug('');
313
314 shouldBe("setThenReadSelectorText('*:active')", "':active'");
315 shouldBe("setThenReadSelectorText('|a')", "'a'");
316
317 debug('');
318
319 shouldBe("setThenReadSelectorText('input[type=file]:focus')", "'input[type=\"file\"]:focus'");
320
321 debug('');
322
323 shouldBe("setThenReadSelectorText('a>>b')", "'a >> b'");
324 shouldBe("setThenReadSelectorText('a >>b')", "'a >> b'");
325 shouldBe("setThenReadSelectorText('a        >>b')", "'a >> b'");
326 shouldBe("setThenReadSelectorText('a>> b')", "'a >> b'");
327 shouldBe("setThenReadSelectorText('a>>       b')", "'a >> b'");
328 shouldBe("setThenReadSelectorText('a        >>       b')", "'a >> b'");
329 shouldBe("setThenReadSelectorText('a+b')", "'a + b'");
330 shouldBe("setThenReadSelectorText('a~b')", "'a ~ b'");
331 shouldBe("setThenReadSelectorText('a>b')", "'a > b'");
332
333 debug('');
334
335 shouldBe("setThenReadSelectorText(':after')", "'::after'");
336 shouldBe("setThenReadSelectorText(':before')", "'::before'");
337 shouldBe("setThenReadSelectorText(':first-letter')", "'::first-letter'");
338 shouldBe("setThenReadSelectorText(':first-line')", "'::first-line'");
339 shouldBe("setThenReadSelectorText(':-webkit-any(    a.class1  ,         #id,[attr]  )')","':-webkit-any(a.class1, #id, [attr])'");
340
341 debug('');
342
343 shouldBe("setThenReadSelectorText(':matches(single    )')", "':matches(single)'");
344 shouldBe("setThenReadSelectorText(':matches(a,b    ,p)')", "':matches(a, b, p)'");
345 shouldBe("setThenReadSelectorText(':matches(#alice,                   #bob,#chris)')", "':matches(#alice, #bob, #chris)'");
346 shouldBe("setThenReadSelectorText(':matches(  .selector,#tama,                #hanayo,#midoriko)')", "':matches(.selector, #tama, #hanayo, #midoriko)'");
347 shouldBe("setThenReadSelectorText(':matches(    .name,#ok,:visited   )')", "':matches(.name, #ok, :visited)'");
348 shouldBe("setThenReadSelectorText(':matches(    .name,#ok,    :visited, :link)')", "':matches(.name, #ok, :visited, :link)'");
349 shouldBe("setThenReadSelectorText(':matches(    .name,#ok,    :matches(:visited    ))')", "':matches(.name, #ok, :matches(:visited))'");
350 shouldBe("setThenReadSelectorText(':matches(.name,  #ok,:not(:link))')", "':matches(.name, #ok, :not(:link))'");
351 shouldBe("setThenReadSelectorText(':matches(.name,#ok,:not(:link))')", "':matches(.name, #ok, :not(:link))'");
352 shouldBe("setThenReadSelectorText(':matches(    .name,#ok,:-webkit-any(   hello))')", "':matches(.name, #ok, :-webkit-any(hello))'");
353 shouldBe("setThenReadSelectorText(':matches(    .name,#ok, :-webkit-any(.selector, #tama, #hanayo, #midoriko))')", "':matches(.name, #ok, :-webkit-any(.selector, #tama, #hanayo, #midoriko))'");
354 shouldBe("setThenReadSelectorText(':matches(       [type=\"file\"])')", "':matches([type=\"file\"])'");
355 shouldBe("setThenReadSelectorText(':matches(  :hover    )')", "':matches(:hover)'");
356 shouldBe("setThenReadSelectorText('input:matches([type=\"file\"],:hover,:focus):enabled')", "'input:matches([type=\"file\"], :hover, :focus):enabled'");
357 shouldBe("setThenReadSelectorText(':matches(input[type=\"file\"], a:hover, button:focus)')", "':matches(input[type=\"file\"], a:hover, button:focus)'");
358 shouldBe("setThenReadSelectorText(':matches( .class1.class2.class3   )')", "':matches(.class1.class2.class3)'");
359 shouldBe("setThenReadSelectorText(':matches(.class1:hover   )')", "':matches(.class1:hover)'");
360 shouldBe("setThenReadSelectorText(':matches(a.class1.class2.class3:hover   )')", "':matches(a.class1.class2.class3:hover)'");
361 shouldBe("setThenReadSelectorText(':matches(:first-letter,::first-line)')", "':matches(::first-letter, ::first-line)'");
362 shouldBe("setThenReadSelectorText(':matches(a>:first-letter,b   ~ ::first-line, c :after, d+ :before)')", "':matches(a > ::first-letter, b ~ ::first-line, c ::after, d + ::before)'");
363 shouldBe("setThenReadSelectorText(':matches(.ok a >    ::first-letter, .ok b~ ::first-line, .ok c :after, .ok d +:before)')", "':matches(.ok a > ::first-letter, .ok b ~ ::first-line, .ok c ::after, .ok d + ::before)'");
364 shouldBe("setThenReadSelectorText(':matches(.ok a> .ok ::first-letter, .ok b   ~.ok :first-line, .ok c .ok    ::after, .ok d + .ok ::before)')", "':matches(.ok a > .ok ::first-letter, .ok b ~ .ok ::first-line, .ok c .ok ::after, .ok d + .ok ::before)'");
365
366 debug('');
367
368 shouldBe("setThenReadSelectorText(':not(single    )')", "':not(single)'");
369 shouldBe("setThenReadSelectorText(':not(a,b    ,p)')", "':not(a, b, p)'");
370 shouldBe("setThenReadSelectorText(':not(#alice,                   #bob,#chris)')", "':not(#alice, #bob, #chris)'");
371 shouldBe("setThenReadSelectorText(':not(  .selector,#tama,                #hanayo,#midoriko)')", "':not(.selector, #tama, #hanayo, #midoriko)'");
372 shouldBe("setThenReadSelectorText(':not(    .name,#ok,:visited   )')", "':not(.name, #ok, :visited)'");
373 shouldBe("setThenReadSelectorText(':not(    .name,#ok,    :visited, :link)')", "':not(.name, #ok, :visited, :link)'");
374 shouldBe("setThenReadSelectorText(':not(    .name,#ok,    :not(:visited    ))')", "':not(.name, #ok, :not(:visited))'");
375 shouldBe("setThenReadSelectorText(':not(.name,  #ok,:not(:link))')", "':not(.name, #ok, :not(:link))'");
376 shouldBe("setThenReadSelectorText(':not(.name,#ok,:not(:link))')", "':not(.name, #ok, :not(:link))'");
377 shouldBe("setThenReadSelectorText(':not(    .name,#ok,:-webkit-any(   hello))')", "':not(.name, #ok, :-webkit-any(hello))'");
378 shouldBe("setThenReadSelectorText(':not(    .name,#ok, :-webkit-any(.selector, #tama, #hanayo, #midoriko))')", "':not(.name, #ok, :-webkit-any(.selector, #tama, #hanayo, #midoriko))'");
379 shouldBe("setThenReadSelectorText(':not(       [type=\"file\"])')", "':not([type=\"file\"])'");
380 shouldBe("setThenReadSelectorText(':not(  :hover    )')", "':not(:hover)'");
381 shouldBe("setThenReadSelectorText('input:not([type=\"file\"],:hover,:focus):enabled')", "'input:not([type=\"file\"], :hover, :focus):enabled'");
382 shouldBe("setThenReadSelectorText(':not(input[type=\"file\"], a:hover, button:focus)')", "':not(input[type=\"file\"], a:hover, button:focus)'");
383 shouldBe("setThenReadSelectorText(':not( .class1.class2.class3   )')", "':not(.class1.class2.class3)'");
384 shouldBe("setThenReadSelectorText(':not(.class1:hover   )')", "':not(.class1:hover)'");
385 shouldBe("setThenReadSelectorText(':not(a.class1.class2.class3:hover   )')", "':not(a.class1.class2.class3:hover)'");
386 shouldBe("setThenReadSelectorText(':not(:matches(single    ),:matches(a,b    ,p),:matches(#alice,                   #bob,#chris))')", "':not(:matches(single), :matches(a, b, p), :matches(#alice, #bob, #chris))'");
387
388 debug('');
389
390 </script>
391 <script src="../../resources/js-test-post.js"></script>
392 </body>
393 </html>