| OLD | NEW |
| (Empty) | |
| 1 <script> |
| 2 if (window.testRunner) |
| 3 testRunner.waitUntilDone(); |
| 4 |
| 5 function doTest() { |
| 6 finishTestInXFrames(2); |
| 7 } |
| 8 |
| 9 function finishTestInXFrames(frames) { |
| 10 if (frames > 0) { |
| 11 requestAnimationFrame(finishTestInXFrames.bind(null, frames - 1)); |
| 12 return; |
| 13 } |
| 14 finishTest(); |
| 15 } |
| 16 |
| 17 function finishTest() { |
| 18 for (const scroller of document.querySelectorAll('.scroller')) { |
| 19 scroller.scrollTop = 200; |
| 20 } |
| 21 if (window.testRunner) |
| 22 testRunner.notifyDone(); |
| 23 } |
| 24 |
| 25 window.addEventListener('load', doTest, false); |
| 26 </script> |
| 27 <style> |
| 28 body { |
| 29 margin: 0; |
| 30 } |
| 31 |
| 32 .group { |
| 33 display: inline-block; |
| 34 position: relative; |
| 35 width: 250px; |
| 36 height: 350px; |
| 37 } |
| 38 |
| 39 .scroller { |
| 40 will-change: transform; |
| 41 |
| 42 overflow: hidden; /* hide scrollbars */ |
| 43 width: 200px; |
| 44 height: 350px; |
| 45 outline: 2px solid black; |
| 46 } |
| 47 |
| 48 .container { |
| 49 width: 200px; |
| 50 height: 700px; |
| 51 } |
| 52 |
| 53 .outerSticky { |
| 54 will-change: transform; |
| 55 |
| 56 position: sticky; |
| 57 background-color: green; |
| 58 width: 200px; |
| 59 height: 200px; |
| 60 } |
| 61 |
| 62 .innerSticky { |
| 63 will-change: transform; |
| 64 |
| 65 position: sticky; |
| 66 background-color: red; |
| 67 width: 200px; |
| 68 height: 100px; |
| 69 } |
| 70 </style> |
| 71 |
| 72 <div class="group"> |
| 73 <div class="scroller"> |
| 74 <div class="container"> |
| 75 <div class="outerSticky" style="top: 50px;"> |
| 76 <div class="innerSticky" style="top: 50px;"></div> |
| 77 </div> |
| 78 </div> |
| 79 </div> |
| 80 </div> |
| 81 |
| 82 <div class="group"> |
| 83 <div class="scroller"> |
| 84 <div class="container"> |
| 85 <div class="outerSticky" style="top: 50px;"> |
| 86 <div class="innerSticky" style="top: 100px;"></div> |
| 87 </div> |
| 88 </div> |
| 89 </div> |
| 90 </div> |
| 91 |
| 92 <div class="group"> |
| 93 <div class="scroller"> |
| 94 <div class="container"> |
| 95 <div class="outerSticky" style="top: 50px;"> |
| 96 <div class="innerSticky" style="top: 300px;"></div> |
| 97 </div> |
| 98 </div> |
| 99 </div> |
| 100 </div> |
| OLD | NEW |