OLD | NEW |
(Empty) | |
| 1 <style> |
| 2 body { |
| 3 margin: 0; |
| 4 } |
| 5 |
| 6 table { |
| 7 background: red; |
| 8 border-collapse: collapse; |
| 9 } |
| 10 |
| 11 td, th { |
| 12 height: 50px; |
| 13 width: 50px; |
| 14 padding: 0; |
| 15 } |
| 16 |
| 17 th { |
| 18 background: green; |
| 19 } |
| 20 |
| 21 .scroller { |
| 22 will-change: transform; |
| 23 |
| 24 overflow: hidden; /* hide scrollbars */ |
| 25 width: 100px; |
| 26 height: 200px; |
| 27 outline: 2px solid black; |
| 28 } |
| 29 |
| 30 .sticky { |
| 31 will-change: transform; |
| 32 |
| 33 position: sticky; |
| 34 top: 25px; |
| 35 } |
| 36 </style> |
| 37 |
| 38 <script> |
| 39 if (window.testRunner) |
| 40 testRunner.waitUntilDone(); |
| 41 |
| 42 function finishTest() { |
| 43 document.querySelector('.scroller').scrollTop = 200; |
| 44 if (window.testRunner) |
| 45 testRunner.notifyDone(); |
| 46 } |
| 47 |
| 48 window.addEventListener('load', function() { |
| 49 requestAnimationFrame(function() { |
| 50 requestAnimationFrame(finishTest); |
| 51 }); |
| 52 }); |
| 53 </script> |
| 54 |
| 55 |
| 56 <div class="scroller"> |
| 57 <table> |
| 58 <thead class="sticky"> |
| 59 <tr class="sticky"> |
| 60 <th class="sticky"></th> |
| 61 </tr> |
| 62 </thead> |
| 63 <tbody> |
| 64 <tr><td></td></tr> |
| 65 <tr><td></td></tr> |
| 66 <tr><td></td></tr> |
| 67 <tr><td></td></tr> |
| 68 <tr><td></td></tr> |
| 69 <tr><td></td></tr> |
| 70 <tr><td></td></tr> |
| 71 <tr><td></td></tr> |
| 72 <tr><td></td></tr> |
| 73 </tbody> |
| 74 </table> |
| 75 </div> |
OLD | NEW |