OLD | NEW |
(Empty) | |
| 1 <style> |
| 2 body { |
| 3 margin: 0; |
| 4 } |
| 5 |
| 6 .scroller { |
| 7 will-change: transform; |
| 8 |
| 9 overflow: hidden; /* hide scrollbars */ |
| 10 width: 200px; |
| 11 height: 350px; |
| 12 outline: 2px solid black; |
| 13 } |
| 14 |
| 15 .container { |
| 16 width: 200px; |
| 17 height: 700px; |
| 18 } |
| 19 |
| 20 .outerSticky { |
| 21 will-change: transform; |
| 22 |
| 23 display: inline; |
| 24 position: sticky; |
| 25 top: 0; |
| 26 } |
| 27 |
| 28 .innerSticky { |
| 29 will-change: transform; |
| 30 |
| 31 display: inline; |
| 32 position: sticky; |
| 33 top: 25px; |
| 34 } |
| 35 </style> |
| 36 |
| 37 <script> |
| 38 if (window.testRunner) |
| 39 testRunner.waitUntilDone(); |
| 40 |
| 41 function finishTest() { |
| 42 document.querySelector('.scroller').scrollTop = 200; |
| 43 if (window.testRunner) |
| 44 testRunner.notifyDone(); |
| 45 } |
| 46 |
| 47 window.addEventListener('load', function() { |
| 48 requestAnimationFrame(function() { |
| 49 requestAnimationFrame(finishTest); |
| 50 }); |
| 51 }); |
| 52 </script> |
| 53 |
| 54 <div class="scroller"> |
| 55 <div class="container"> |
| 56 <div class="outerSticky">1<div class="innerSticky">2</div></div> |
| 57 </div> |
| 58 </div> |
OLD | NEW |