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 <script src="resources/shadow-dom.js"></script> | 5 <script src="resources/shadow-dom.js"></script> |
6 <style> | 6 <style> |
7 :host { | 7 :host { |
8 background-color: red; | 8 background-color: red; |
9 } | 9 } |
10 </style> | 10 </style> |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 createShadowRoot( | 120 createShadowRoot( |
121 createDOM('style', {}, | 121 createDOM('style', {}, |
122 document.createTextNode(':host(div.foobar) { background-color: gr
een; }')), | 122 document.createTextNode(':host(div.foobar) { background-color: gr
een; }')), |
123 createDOM('div', {}, | 123 createDOM('div', {}, |
124 document.createTextNode('Hello'))))); | 124 document.createTextNode('Hello'))))); |
125 | 125 |
126 backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); | 126 backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); |
127 | 127 |
128 cleanUp(); | 128 cleanUp(); |
129 | 129 |
130 debug(':host with :ancestor in a shadow tree should match its shadow host.'); | 130 debug(':host with :host-context in a shadow tree should match its shadow host.')
; |
131 | 131 |
132 sandbox.appendChild( | 132 sandbox.appendChild( |
133 createDOM('div', {'id': 'host', 'class': 'foobar'}, | 133 createDOM('div', {'id': 'host', 'class': 'foobar'}, |
134 createShadowRoot( | 134 createShadowRoot( |
135 createDOM('style', {}, | 135 createDOM('style', {}, |
136 document.createTextNode(':host(:ancestor(body.mytheme)) { backgro
und-color: green; }')), | 136 document.createTextNode(':host(:host-context(body.mytheme)) { bac
kground-color: green; }')), |
137 createDOM('div', {}, | 137 createDOM('div', {}, |
138 document.createTextNode('Hello'))))); | 138 document.createTextNode('Hello'))))); |
139 | 139 |
140 backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); | 140 backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); |
141 | 141 |
142 cleanUp(); | 142 cleanUp(); |
143 | 143 |
144 debug(':host takes simple selectors and matches when one of the simple selectors
matches.'); | 144 debug(':host takes simple selectors and matches when one of the simple selectors
matches.'); |
145 | 145 |
146 sandbox.appendChild( | 146 sandbox.appendChild( |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 document.createTextNode(':host(div) > div { background-color: re
d; }')), | 271 document.createTextNode(':host(div) > div { background-color: re
d; }')), |
272 createDOM('div', {'id': 'target'}, | 272 createDOM('div', {'id': 'target'}, |
273 document.createTextNode('Hello'))))); | 273 document.createTextNode('Hello'))))); |
274 | 274 |
275 backgroundColorShouldBe('host/target', 'rgb(0, 128, 0)'); | 275 backgroundColorShouldBe('host/target', 'rgb(0, 128, 0)'); |
276 | 276 |
277 cleanUp(); | 277 cleanUp(); |
278 | 278 |
279 </script> | 279 </script> |
280 </body> | 280 </body> |
OLD | NEW |