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-context(div, body.mytheme, p#myid, .bar::before, span:hover) > div { d
isplay: block; } | 6 .foo:host-context(div, body.mytheme, p#myid, .bar:first-child, span:hover) > div
{ display: block; } |
7 :host-context(*) { display: block; } | 7 :host-context(*) { display: block; } |
8 </style> | 8 </style> |
9 <style id="style-invalid"> | 9 <style id="style-invalid"> |
10 :host-context(div div) { display: block } | 10 :host-context(div div) { display: block } |
11 :host-context(div > div) { display: block } | 11 :host-context(div > div) { display: block } |
12 :host-context(div + div) { display: block } | 12 :host-context(div + div) { display: block } |
13 :host-context(div ~ div) { display: block } | 13 :host-context(div ~ div) { display: block } |
14 :host-context) { display: block } | 14 :host-context) { display: block } |
15 :host-context() { display: block; } | 15 :host-context() { display: block; } |
16 </style> | 16 </style> |
17 </head> | 17 </head> |
18 <script> | 18 <script> |
19 description("Test for cssText of ':host-context()' rule."); | 19 description("Test for cssText of ':host-context()' rule."); |
20 shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(0).
cssText", ".foo:host-context(div,body.mytheme,p#myid,.bar::before,span:hover) >
div { display: block; }"); | 20 shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(0).
cssText", ".foo:host-context(div,body.mytheme,p#myid,.bar:first-child,span:hover
) > div { display: block; }"); |
21 shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(1).
cssText", ":host-context(*) { display: block; }"); | 21 shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(1).
cssText", ":host-context(*) { display: block; }"); |
22 shouldBe("document.getElementById('style-invalid').sheet.cssRules.length", "0"); | 22 shouldBe("document.getElementById('style-invalid').sheet.cssRules.length", "0"); |
23 </script> | 23 </script> |
24 </html> | 24 </html> |
OLD | NEW |