OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <style id="style1"> | 5 <style id="style1"> |
6 .foo:host(div, body.mytheme, p#myid, .bar::before, span:hover) > div { display:
block; } | 6 .foo:host(div, body.mytheme, p#myid, .bar:first-child, span:hover) > div { displ
ay: block; } |
7 :host { display: block; } | 7 :host { display: block; } |
8 :host(*) { display: block; } | 8 :host(*) { display: block; } |
9 </style> | 9 </style> |
10 <style id="style-invalid"> | 10 <style id="style-invalid"> |
11 :host(div div) { display: block } | 11 :host(div div) { display: block } |
12 :host(div > div) { display: block } | 12 :host(div > div) { display: block } |
13 :host(div + div) { display: block } | 13 :host(div + div) { display: block } |
14 :host(div ~ div) { display: block } | 14 :host(div ~ div) { display: block } |
15 :host) { display: block } | 15 :host) { display: block } |
16 :host() { display: block; } | 16 :host() { display: block; } |
17 </style> | 17 </style> |
18 </head> | 18 </head> |
19 <script> | 19 <script> |
20 description("Test for cssText of ':host()' rule."); | 20 description("Test for cssText of ':host()' rule."); |
21 shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(0).
cssText", ".foo:host(div,body.mytheme,p#myid,.bar::before,span:hover) > div { di
splay: block; }"); | 21 shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(0).
cssText", ".foo:host(div,body.mytheme,p#myid,.bar:first-child,span:hover) > div
{ display: block; }"); |
22 shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(1).
cssText", ":host { display: block; }"); | 22 shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(1).
cssText", ":host { display: block; }"); |
23 shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(2).
cssText", ":host(*) { display: block; }"); | 23 shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(2).
cssText", ":host(*) { display: block; }"); |
24 shouldBe("document.getElementById('style-invalid').sheet.cssRules.length", "0"); | 24 shouldBe("document.getElementById('style-invalid').sheet.cssRules.length", "0"); |
25 </script> | 25 </script> |
26 </html> | 26 </html> |
OLD | NEW |