| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html><body> | 2 <html><body> |
| 3 | 3 |
| 4 <style> | 4 <style> |
| 5 #host { | 5 #host { |
| 6 width: 200px; | 6 width: 200px; |
| 7 height: 100px; | 7 height: 100px; |
| 8 background-color: blue; | 8 background-color: blue; |
| 9 } | 9 } |
| 10 | 10 |
| 11 #host::-webkit-scrollbar { | 11 #host::-webkit-scrollbar { |
| 12 width: 50px; | 12 width: 50px; |
| 13 } | 13 } |
| 14 | 14 |
| 15 * /deep/ #div1 { | 15 </style> |
| 16 position: fixed; | 16 <style id="shadow-style"> |
| 17 overflow: scroll; | 17 #div1 { |
| 18 width: 80px; | 18 position: fixed; |
| 19 height: 80px; | 19 overflow: scroll; |
| 20 background-color: red; | 20 width: 80px; |
| 21 height: 80px; |
| 22 background-color: red; |
| 21 } | 23 } |
| 22 | 24 |
| 23 * /deep/ #div1::-webkit-scrollbar { | 25 #div1::-webkit-scrollbar { |
| 24 width: 20px; | 26 width: 20px; |
| 25 } | 27 } |
| 26 </style> | 28 </style> |
| 27 | 29 |
| 28 <div id="host"></div> | 30 <div id="host"></div> |
| 29 | 31 |
| 32 |
| 30 <script> | 33 <script> |
| 31 var shadowRoot = host.createShadowRoot(); | 34 var shadowRoot = host.createShadowRoot(); |
| 32 shadowRoot.innerHTML = '<div id="div1">some long text showing scrollbar</div>'; | 35 shadowRoot.innerHTML = '<div id="div1">some long text showing scrollbar</div>'; |
| 36 shadowRoot.appendChild(document.querySelector('#shadow-style')); |
| 33 </script> | 37 </script> |
| 34 | 38 |
| 35 </body></html> | 39 </body></html> |
| OLD | NEW |