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.hello div) { color: gr
een; }'; | 10 shadowStyle.innerHTML = |
| 11 'content::-webkit-distributed(+ div1 div2) { color: green; }' + |
| 12 'content::-webkit-distributed(~ div1 div2) { color: green; }'; |
11 | 13 |
12 var sandbox = document.getElementById('sandbox'); | 14 var sandbox = document.getElementById('sandbox'); |
13 sandbox.appendChild( | 15 sandbox.appendChild( |
14 createDOM('div', {'id': 'host'}, | 16 createDOM('div', {}, |
15 createShadowRoot( | 17 createShadowRoot( |
16 shadowStyle, | 18 shadowStyle, |
17 createDOM('content')), | 19 createDOM('content')), |
18 createDOM('div', {'class': 'hello'}, | |
19 document.createTextNode('normal'), | |
20 createDOM('div', {}, | |
21 document.createTextNode('green'))), | |
22 createDOM('div', {}, | 20 createDOM('div', {}, |
23 document.createTextNode('normal'), | 21 createDOM('div1', {}, |
24 createDOM('div', {}, | 22 createDOM('div2', {}, |
| 23 document.createTextNode('normal'))))
, |
| 24 createDOM('div1', {}, |
| 25 createDOM('div2', {}, |
25 document.createTextNode('normal'))))); | 26 document.createTextNode('normal'))))); |
26 </script> | 27 </script> |
27 </body> | 28 </body> |
28 </html> | 29 </html> |
OLD | NEW |