Regression(r188105): Seems to have caused crashes during PLT on some iPads
[WebKit-https.git] / LayoutTests / fast / css / parsing-css-attribute-case-insensitive-value-4.html
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 <style id="style-container">
6     :matches(#notthere >> div, #target) {
7         background-color: red;
8     }
9
10     /* This selector list is invalid because the attribute flag "invalid" is invalid. */
11     :matches(#nothere >> valid, #notthere >> [invalid="yep" invalid], #target) {
12         background-color: blue;
13     }
14
15     :matches(#notthere >> foobar, #target) {
16         color: lime;
17     }
18
19     /* This selector list is invalid because the attribute flag "u" is invalid. */
20     :matches(#nothere >> valid, #notthere >> [invalid="yep" u], #target) {
21         color: blue;
22     }
23
24 </style>
25 </head>
26 <body>
27 <div id="target" style="display:none;"></div>
28 </body>
29 <script>
30 description('This test verify that invalid case-insenstivie attribute value matching (e.g. [foo=bar i]) do not affect surrounding rules.');
31
32 shouldBeEqualToString("getComputedStyle(document.getElementById('target')).color", "rgb(0, 255, 0)");
33 shouldBeEqualToString("getComputedStyle(document.getElementById('target')).backgroundColor", "rgb(255, 0, 0)");
34 shouldBe("document.getElementById('style-container').sheet.cssRules.length", "2");
35 shouldBeEqualToString("document.getElementById('style-container').sheet.cssRules[0].selectorText", ":matches(#notthere >> div, #target)");
36 shouldBeEqualToString("document.getElementById('style-container').sheet.cssRules[0].cssText", ":matches(#notthere >> div, #target) { background-color: red; }");
37 shouldBeEqualToString("document.getElementById('style-container').sheet.cssRules[1].selectorText", ":matches(#notthere >> foobar, #target)");
38 shouldBeEqualToString("document.getElementById('style-container').sheet.cssRules[1].cssText", ":matches(#notthere >> foobar, #target) { color: lime; }");
39 </script>
40 <script src="../../resources/js-test-post.js"></script>
41 </html>