OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>::slotted pseudo elements with dynamic attribute change</title> | |
rune
2016/01/20 12:53:32
We normally drop <title>. Also, in this case it's
kochi
2016/01/21 05:09:36
Done.
| |
3 <div id="host"> | |
4 <div id="child">I should be green.</div> | |
5 </div> | |
6 <script> | |
7 if (window.testRunner) | |
8 testRunner.waitUntilDone(); | |
9 | |
10 var shadowRoot = document.getElementById('host').attachShadow({mode: 'open'}); | |
11 shadowRoot.innerHTML = '<style>slot::slotted(.selected) { ' + | |
12 'background: green; }</style>' + | |
13 '<slot></slot>'; | |
14 | |
15 setTimeout(function() { | |
16 document.getElementById('child').classList.add('selected'); | |
17 if (window.testRunner) | |
18 testRunner.notifyDone(); | |
19 }, 0); | |
20 </script> | |
OLD | NEW |