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