| OLD | NEW |
| 1 <script> | 1 <script> |
| 2 onload = function() { | 2 onload = function() { |
| 3 scroller.scrollTop = 200; | 3 scroller.scrollTop = 200; |
| 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 overflow: scroll; | 13 overflow: scroll; |
| 13 height: 200px; | 14 height: 200px; |
| 14 width: 200px; | 15 width: 200px; |
| 15 } | 16 } |
| 16 | 17 |
| 17 .container { | 18 .container { |
| 18 height: 500px; | 19 height: 500px; |
| 19 background: red; | 20 background: red; |
| 20 } | 21 } |
| 21 | 22 |
| 22 .sticky { | 23 .sticky { |
| 23 position: sticky; | 24 position: sticky; |
| 24 top: 25px; | 25 top: 25px; |
| 25 height: 50px; | 26 height: 50px; |
| 26 background: green; | 27 background: green; |
| 27 } | 28 } |
| 28 </style> | 29 </style> |
| 29 <div id="scroller" class="composited"> | 30 <div id="scroller" class="composited"> |
| 30 <div class="composited container"> | 31 <div class="composited container"> |
| 31 <div class="composited sticky"></div> | 32 <div class="composited sticky"></div> |
| 32 </div> | 33 </div> |
| 33 </div> | 34 </div> |
| OLD | NEW |