| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
| 3 <script src="resources/shadow-dom.js"></script> | 3 <script src="resources/shadow-dom.js"></script> |
| 4 <style> | 4 <style> |
| 5 :host { | 5 :host { |
| 6 background-color: red; | 6 background-color: red; |
| 7 } | 7 } |
| 8 </style> | 8 </style> |
| 9 <body class='mytheme'> | 9 <body class='mytheme'> |
| 10 <div> | 10 <div> |
| 11 <div id='sandbox'></div> | 11 <div id='sandbox'></div> |
| 12 </div> | 12 </div> |
| 13 <pre id='console'></pre> | 13 <pre id='console'></pre> |
| 14 <script> | 14 <script> |
| 15 description('Test whether :host matches a shadow host correctly.'); | 15 description('Test whether :host matches a shadow host correctly.'); |
| 16 | 16 |
| 17 var sandbox = document.getElementById('sandbox'); | 17 var sandbox = document.getElementById('sandbox'); |
| 18 | 18 |
| 19 function backgroundColorOf(selector) { | |
| 20 return window.getComputedStyle(getNodeInTreeOfTrees(selector)).backgroundCol
or; | |
| 21 } | |
| 22 | |
| 23 function backgroundColorShouldBe(selector, expected) { | |
| 24 shouldBeEqualToString('backgroundColorOf(\'' + selector + '\')', expected); | |
| 25 } | |
| 26 | |
| 27 function cleanUp() { | 19 function cleanUp() { |
| 28 sandbox.innerHTML = ''; | 20 sandbox.innerHTML = ''; |
| 29 } | 21 } |
| 30 | 22 |
| 31 debug(':host out of shadow tree should not match any shadow hosts.'); | 23 debug(':host out of shadow tree should not match any shadow hosts.'); |
| 32 | 24 |
| 33 sandbox.appendChild( | 25 sandbox.appendChild( |
| 34 createDOM('div', {'id': 'host'}, | 26 createDOM('div', {'id': 'host'}, |
| 35 createShadowRoot( | 27 createShadowRoot( |
| 36 createDOM('div', {}, | 28 createDOM('div', {}, |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 createShadowRoot( | 271 createShadowRoot( |
| 280 createDOM('style', {}, | 272 createDOM('style', {}, |
| 281 document.createTextNode(':host.foo { background-color: green; }'
))))); | 273 document.createTextNode(':host.foo { background-color: green; }'
))))); |
| 282 | 274 |
| 283 backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); | 275 backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); |
| 284 | 276 |
| 285 cleanUp(); | 277 cleanUp(); |
| 286 | 278 |
| 287 </script> | 279 </script> |
| 288 </body> | 280 </body> |
| OLD | NEW |