OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="resources/shadow-dom.js"></script> | 4 <script src="resources/shadow-dom.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <div id="sandbox"></div> | 7 <div id="sandbox"></div> |
8 <script> | 8 <script> |
9 var shadowStyle = document.createElement('style'); | 9 var shadowStyle = document.createElement('style'); |
10 shadowStyle.innerHTML = 'content::-webkit-distributed(div) { color: green; }'; | 10 shadowStyle.innerHTML = 'content::-webkit-distributed(> div1 div2) { color: gree
n; }'; |
11 | 11 |
12 var sandbox = document.getElementById('sandbox'); | 12 var sandbox = document.getElementById('sandbox'); |
13 sandbox.appendChild( | 13 sandbox.appendChild( |
14 createDOM('div', {}, | 14 createDOM('div', {}, |
15 createShadowRoot( | 15 createShadowRoot( |
16 shadowStyle, | 16 shadowStyle, |
17 createDOM('content')), | 17 createDOM('content')), |
18 createDOM('p', {}, | 18 createDOM('div', {}, |
19 createDOM('div', {}, | 19 createDOM('div1', {}, |
| 20 createDOM('div2', {}, |
| 21 document.createTextNode('normal'))))
, |
| 22 createDOM('div1', {}, |
| 23 createDOM('div2', {}, |
20 document.createTextNode('green'))))); | 24 document.createTextNode('green'))))); |
21 </script> | 25 </script> |
22 </body> | 26 </body> |
23 </html> | 27 </html> |
OLD | NEW |