| 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 height: 2000px; | |
| 14 overflow: hidden; /* hide scrollbars */ | |
| 15 } | |
| 16 | |
| 17 .group { | |
| 18 display: inline-block; | |
| 19 position: relative; | |
| 20 width: 250px; | |
| 21 height: 500px; | |
| 22 } | |
| 23 | |
| 24 .container { | |
| 25 width: 200px; | |
| 26 height: 400px; | |
| 27 outline: 2px solid black; | |
| 28 } | |
| 29 | |
| 30 .box { | |
| 31 width: 200px; | |
| 32 height: 200px; | |
| 33 } | |
| 34 | |
| 35 .sticky { | |
| 36 position: sticky; | |
| 37 top: 100px; | |
| 38 bottom: 500px; | |
| 39 background-color: green; | |
| 40 } | |
| 41 | |
| 42 .indicator { | |
| 43 position: absolute; | |
| 44 top: 0; | |
| 45 left: 0; | |
| 46 background-color: red; | |
| 47 } | |
| 48 </style> | |
| 49 <script> | |
| 50 function doTest() | |
| 51 { | |
| 52 window.scrollTo(0, 100); | |
| 53 } | |
| 54 window.addEventListener('load', doTest, false); | |
| 55 </script> | |
| 56 </head> | |
| 57 <body> | |
| 58 <div class="group"> | |
| 59 <div class="indicator box" style="top: 200px;"></div> | |
| 60 <div class="container"> | |
| 61 <div class="sticky box"></div> | |
| 62 </div> | |
| 63 </div> | |
| 64 | |
| 65 <div class="group" style="top: 100px"> | |
| 66 <div class="indicator box" style="top: 100px;"></div> | |
| 67 <div class="container"> | |
| 68 <div class="sticky box"></div> | |
| 69 </div> | |
| 70 </div> | |
| 71 | |
| 72 <div class="group" style="top: 200px"> | |
| 73 <div class="indicator box" style="top: 0;"></div> | |
| 74 <div class="container"> | |
| 75 <div class="sticky box"></div> | |
| 76 </div> | |
| 77 </div> | |
| 78 <div style="position: absolute; top: 620px;"> | |
| 79 This test checks that sticky positioned table theads are contained by th
eir table. | |
| 80 There should be no red. | |
| 81 </div> | |
| 82 </body> | |
| 83 </html> | |
| OLD | NEW |