| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>/content/ combinator with dynamic attribute change</title> | |
| 5 <script src="resources/shadow-dom.js"></script> | |
| 6 <script src="../../../resources/js-test.js"></script> | |
| 7 </head> | |
| 8 <body> | |
| 9 <div id="sandbox"> | |
| 10 </div> | |
| 11 <pre id="console"></pre> | |
| 12 <script> | |
| 13 var sandbox = document.getElementById('sandbox'); | |
| 14 sandbox.appendChild( | |
| 15 createDOM('div', {'id': 'host'}, | |
| 16 createShadowRoot( | |
| 17 createDOM('style', {}, | |
| 18 document.createTextNode('content /content/ .selected { color: gr
een; }')), | |
| 19 createDOM('content')), | |
| 20 createDOM('div', {'id': 'child'}, | |
| 21 document.createTextNode('I should be green.')))); | |
| 22 shouldNotBe('window.getComputedStyle(document.querySelector("#host > #child")).c
olor', '"rgb(0, 128, 0)"'); | |
| 23 document.body.offsetLeft; | |
| 24 | |
| 25 document.getElementById('child').classList.add('selected'); | |
| 26 shouldBe('window.getComputedStyle(document.querySelector("#host > #child")).colo
r', '"rgb(0, 128, 0)"'); | |
| 27 | |
| 28 sandbox.innerHTML = ''; | |
| 29 </script> | |
| 30 </body> | |
| 31 </html> | |
| OLD | NEW |