| 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.scrollLeft = 200; |
| 20 } |
| 21 if (window.testRunner) |
| 22 testRunner.notifyDone(); |
| 23 } |
| 24 |
| 25 window.addEventListener('load', doTest, false); |
| 26 </script> |
| 27 |
| 28 <style> |
| 29 body { |
| 30 margin: 0; |
| 31 } |
| 32 |
| 33 .group { |
| 34 position: relative; |
| 35 width: 350px; |
| 36 height: 200px; |
| 37 } |
| 38 |
| 39 .scroller { |
| 40 will-change: transform; |
| 41 |
| 42 overflow: hidden; /* hide scrollbars */ |
| 43 width: 350px; |
| 44 height: 180px; |
| 45 outline: 2px solid black; |
| 46 } |
| 47 |
| 48 .container { |
| 49 width: 700px; |
| 50 height: 180px; |
| 51 } |
| 52 |
| 53 .outerSticky { |
| 54 will-change: transform; |
| 55 |
| 56 display: inline-block; |
| 57 position: sticky; |
| 58 background-color: green; |
| 59 width: 200px; |
| 60 height: 180px; |
| 61 } |
| 62 |
| 63 .innerSticky { |
| 64 will-change: transform; |
| 65 |
| 66 display: inline-block; |
| 67 position: sticky; |
| 68 background-color: red; |
| 69 width: 100px; |
| 70 height: 180px; |
| 71 } |
| 72 </style> |
| 73 |
| 74 <div class="group"> |
| 75 <div class="scroller"> |
| 76 <div class="container"> |
| 77 <div class="outerSticky" style="left: 50px;"> |
| 78 <div class="innerSticky" style="left: 50px;"></div> |
| 79 </div> |
| 80 </div> |
| 81 </div> |
| 82 </div> |
| 83 |
| 84 <div class="group"> |
| 85 <div class="scroller"> |
| 86 <div class="container"> |
| 87 <div class="outerSticky" style="left: 50px;"> |
| 88 <div class="innerSticky" style="left: 100px;"></div> |
| 89 </div> |
| 90 </div> |
| 91 </div> |
| 92 </div> |
| 93 |
| 94 <div class="group"> |
| 95 <div class="scroller"> |
| 96 <div class="container"> |
| 97 <div class="outerSticky" style="left: 50px;"> |
| 98 <div class="innerSticky" style="left: 300px;"></div> |
| 99 </div> |
| 100 </div> |
| 101 </div> |
| 102 </div> |
| OLD | NEW |