| <!DOCTYPE html> |
| <script src="resources/shadow-dom.js"></script> |
| <script src="../../../resources/js-test.js"></script> |
| |
| <div id="sandbox"></div> |
| |
| <script> |
| description('Test for http://crbug.com/360679, ::content rules in nested ShadowDOM should match correctly.'); |
| |
| var sandbox = document.getElementById('sandbox'); |
| |
| sandbox.appendChild( |
| createDOM('div', {'id': 'host'}, |
| createShadowRoot( |
| createDOM('div', {'id': 'container'}, |
| createShadowRoot( |
| createDOM('style', {}, |
| document.createTextNode( |
| '.foo::content > .special { background: red; }')), |
| createDOM('content')), |
| createDOM('div', {}, |
| createDOM('content', {'class': 'foo'})))), |
| createDOM('div', {'class': 'special'}, |
| document.createTextNode( |
| 'I should not be red.')))); |
| |
| shouldNotBe("window.getComputedStyle(sandbox.querySelector('#host > .special')).backgroundColor", '"rgb(255, 0, 0)"'); |
| </script> |
| |
| |