OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script> |
| 3 if (window.internals) { |
| 4 internals.settings.setCSSStickyPositionEnabled(true); |
| 5 } |
| 6 </script> |
| 7 <html> |
| 8 <head> |
| 9 <script> |
| 10 function done() |
| 11 { |
| 12 if (window.testRunner) |
| 13 window.testRunner.notifyDone(); |
| 14 } |
| 15 |
| 16 if (window.location.hash == '') { |
| 17 if (window.testRunner) |
| 18 window.testRunner.waitUntilDone(); |
| 19 window.onhashchange = done; |
| 20 location = '#hash'; |
| 21 } |
| 22 </script> |
| 23 <style> |
| 24 .group { |
| 25 display: inline-block; |
| 26 position: relative; |
| 27 width: 150px; |
| 28 height: 500px; |
| 29 } |
| 30 |
| 31 #overflow { |
| 32 width: 600px; |
| 33 height: 550px; |
| 34 overflow: hidden; /* Still scrollable with JS */ |
| 35 border: 1px solid black; |
| 36 position: relative; |
| 37 } |
| 38 |
| 39 .spacer { |
| 40 float: left; |
| 41 width: 10px; |
| 42 height: 500px; |
| 43 } |
| 44 .container { |
| 45 width: 100px; |
| 46 height: 400px; |
| 47 outline: 2px solid black; |
| 48 } |
| 49 |
| 50 .box { |
| 51 width: 100px; |
| 52 height: 200px; |
| 53 } |
| 54 |
| 55 .hash { |
| 56 width: 600px; |
| 57 height: 10px; |
| 58 background-color: gray; |
| 59 position: absolute; |
| 60 border: 0px; |
| 61 } |
| 62 |
| 63 .sticky { |
| 64 position: sticky; |
| 65 top: 100px; |
| 66 background-color: green; |
| 67 } |
| 68 |
| 69 .indicator { |
| 70 position: absolute; |
| 71 top: 0; |
| 72 left: 0; |
| 73 background-color: red; |
| 74 } |
| 75 </style> |
| 76 </head> |
| 77 <body> |
| 78 <div id="overflow"> |
| 79 <div class="spacer"></div> |
| 80 <div class="group"> |
| 81 <div class="indicator box" style="top: 200px;"></div> |
| 82 <div class="container"> |
| 83 <div class="sticky box"></div> |
| 84 </div> |
| 85 </div> |
| 86 |
| 87 <div class="group" style="top: 100px"> |
| 88 <div class="indicator box" style="top: 120px;"></div> |
| 89 <div class="container"> |
| 90 <div class="sticky box"></div> |
| 91 </div> |
| 92 </div> |
| 93 |
| 94 <div class="group" style="top: 240px"> |
| 95 <div class="indicator box" style="top: 0;"></div> |
| 96 <div class="container"> |
| 97 <div class="sticky box"></div> |
| 98 </div> |
| 99 </div> |
| 100 <div id="hash" class="hash" style="top: 120px;"> |
| 101 </div> |
| 102 </div> |
| 103 <div style="position: absolute; top: 560px;"> |
| 104 This test checks that sticky positioning when scrolled by fragment. |
| 105 There should be no red. |
| 106 </div> |
| 107 </body> |
| 108 </html> |
| 109 |
OLD | NEW |