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