| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>::content pseudo elements with dynamic attribute change</title> | 4 <title>::slotted pseudo elements with dynamic attribute change</title> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <div id="host"> | 7 <div id="host"> |
| 8 <div id="child">I should be green.</div> | 8 <div id="child">I should be green.</div> |
| 9 </div> | 9 </div> |
| 10 <script> | 10 <script> |
| 11 if (window.testRunner) | 11 if (window.testRunner) |
| 12 testRunner.waitUntilDone(); | 12 testRunner.waitUntilDone(); |
| 13 var shadowRoot = document.getElementById('host').createShadowRoot(); | 13 |
| 14 shadowRoot.innerHTML = '<style>content::content .selected { ' + | 14 var shadowRoot = document.getElementById('host').attachShadow({mode: 'open'}); |
| 15 shadowRoot.innerHTML = '<style>slot::slotted(.selected) { ' + |
| 15 'background: green; }</style>' + | 16 'background: green; }</style>' + |
| 16 '<content></content>'; | 17 '<slot></slot>'; |
| 17 | 18 |
| 18 setTimeout(function() { | 19 setTimeout(function() { |
| 19 document.getElementById('child').classList.add('selected'); | 20 document.getElementById('child').classList.add('selected'); |
| 20 if (window.testRunner) | 21 if (window.testRunner) |
| 21 testRunner.notifyDone(); | 22 testRunner.notifyDone(); |
| 22 }, 0); | 23 }, 0); |
| 24 |
| 23 </script> | 25 </script> |
| 24 </body> | 26 </body> |
| 25 </html> | 27 </html> |
| OLD | NEW |