OLD | NEW |
(Empty) | |
| 1 <style> |
| 2 body { |
| 3 margin: 0; |
| 4 } |
| 5 |
| 6 .container { |
| 7 width: 200px; |
| 8 height: 2000px; |
| 9 } |
| 10 |
| 11 .composited { |
| 12 /* Forces promotion without creating a stacking context. */ |
| 13 backface-visibility: hidden; |
| 14 } |
| 15 |
| 16 .outerSticky { |
| 17 position: sticky; |
| 18 top: 50px; |
| 19 background-color: green; |
| 20 width: 200px; |
| 21 height: 200px; |
| 22 } |
| 23 |
| 24 .middleSticky { |
| 25 position: sticky; |
| 26 top: 100px; |
| 27 background-color: yellow; |
| 28 width: 200px; |
| 29 height: 100px; |
| 30 } |
| 31 |
| 32 .innerSticky { |
| 33 position: sticky; |
| 34 top: 125px; |
| 35 background-color: red; |
| 36 width: 200px; |
| 37 height: 50px; |
| 38 } |
| 39 </style> |
| 40 |
| 41 <script> |
| 42 if (window.testRunner) |
| 43 testRunner.waitUntilDone(); |
| 44 |
| 45 function finishTest() { |
| 46 window.scrollTo(0, 200); |
| 47 if (window.testRunner) |
| 48 testRunner.notifyDone(); |
| 49 } |
| 50 |
| 51 window.addEventListener('load', function() { |
| 52 requestAnimationFrame(function() { |
| 53 requestAnimationFrame(finishTest); |
| 54 }); |
| 55 }); |
| 56 </script> |
| 57 |
| 58 <div class="container"> |
| 59 <div class="outerSticky"> |
| 60 <div class="middleSticky composited"> |
| 61 <div class="innerSticky composited"></div> |
| 62 </div> |
| 63 </div> |
| 64 </div> |
OLD | NEW |