OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <div id="host"> | 2 <div id="host"> |
3 <div id="child">I should be green.</div> | 3 <div id="child">I should be green.</div> |
4 </div> | 4 </div> |
5 <script> | 5 <script> |
6 if (window.testRunner) | 6 if (window.testRunner) |
7 testRunner.waitUntilDone(); | 7 testRunner.waitUntilDone(); |
8 | 8 |
9 var shadowRoot = document.getElementById('host').attachShadow({mode: 'open'}); | 9 var shadowRoot = document.getElementById('host').attachShadow({mode: 'open'}); |
10 shadowRoot.innerHTML = '<style>slot::slotted(.selected) { ' + | 10 shadowRoot.innerHTML = '<style>slot::slotted(.selected) { ' + |
11 'background: green; }</style>' + | 11 'background: green; }</style>' + |
12 '<slot></slot>'; | 12 '<slot></slot>'; |
13 | 13 |
14 setTimeout(function() { | 14 setTimeout(function() { |
15 document.getElementById('child').classList.add('selected'); | 15 document.getElementById('child').classList.add('selected'); |
16 if (window.testRunner) | 16 if (window.testRunner) |
17 testRunner.notifyDone(); | 17 testRunner.notifyDone(); |
18 }, 0); | 18 }, 0); |
19 </script> | 19 </script> |
OLD | NEW |