| OLD | NEW |
| 1 <script> | 1 <script> |
| 2 onload = function() { | 2 onload = function() { |
| 3 scroller.scrollTop = 100; | 3 scroller.scrollTop = 100; |
| 4 } | 4 } |
| 5 </script> | 5 </script> |
| 6 <style> | 6 <style> |
| 7 .composited { | 7 .composited { |
| 8 /* Triggers promotion and creates a stacking context */ |
| 8 will-change: transform; | 9 will-change: transform; |
| 9 } | 10 } |
| 10 | 11 |
| 11 #scroller { | 12 #scroller { |
| 12 background: white; | 13 background: white; |
| 13 height: 200px; | 14 height: 200px; |
| 14 overflow: auto; | 15 overflow: auto; |
| 15 width: 200px; | 16 width: 200px; |
| 16 } | 17 } |
| 17 .sticky { | 18 .sticky { |
| 18 position: relative; | 19 position: relative; |
| 19 top: 100px; | 20 top: 100px; |
| 20 height: 50px; | 21 height: 50px; |
| 21 background: green; | 22 background: green; |
| 22 } | 23 } |
| 23 .spacer { | 24 .spacer { |
| 24 height: 2000px; | 25 height: 2000px; |
| 25 } | 26 } |
| 26 </style> | 27 </style> |
| 27 <div id="scroller" class="composited"> | 28 <div id="scroller" class="composited"> |
| 28 <div class="composited sticky"></div> | 29 <div class="composited sticky"></div> |
| 29 <div class="spacer"></div> | 30 <div class="spacer"></div> |
| 30 </div> | 31 </div> |
| OLD | NEW |