| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <style> | 4 <style> |
| 5 .group { | 5 .group { |
| 6 display: inline-block; | 6 display: inline-block; |
| 7 position: relative; | 7 position: relative; |
| 8 width: 150px; | 8 width: 150px; |
| 9 height: 500px; | 9 height: 500px; |
| 10 } | 10 } |
| 11 | 11 |
| 12 #overflow { | 12 #overflow { |
| 13 width: 600px; | 13 width: 600px; |
| 14 height: 550px; | 14 height: 550px; |
| 15 overflow: hidden; | 15 overflow: hidden; |
| 16 border: 1px solid black; | 16 border: 1px solid black; |
| 17 position: relative; |
| 17 } | 18 } |
| 18 | 19 |
| 19 .spacer { | 20 .spacer { |
| 20 float: left; | 21 float: left; |
| 21 width: 10px; | 22 width: 10px; |
| 22 height: 1200px; | 23 height: 500px; |
| 23 } | 24 } |
| 24 .container { | 25 .container { |
| 25 width: 100px; | 26 width: 100px; |
| 26 height: 400px; | 27 height: 400px; |
| 27 outline: 2px solid black; | 28 outline: 2px solid black; |
| 28 } | 29 } |
| 29 | 30 |
| 30 .box { | 31 .box { |
| 31 width: 100px; | 32 width: 100px; |
| 32 height: 200px; | 33 height: 200px; |
| 33 } | 34 } |
| 34 | 35 |
| 36 .hash { |
| 37 width: 600px; |
| 38 height: 10px; |
| 39 background-color: gray; |
| 40 position: absolute; |
| 41 border: 0px; |
| 42 } |
| 43 |
| 35 .sticky { | 44 .sticky { |
| 36 position: relative; | 45 position: relative; |
| 37 top: 100px; | 46 top: 100px; |
| 38 background-color: green; | 47 background-color: green; |
| 39 } | 48 } |
| 40 </style> | 49 </style> |
| 41 </head> | 50 </head> |
| 42 <body> | 51 <body> |
| 43 This test checks that sticky positioned elements are contained by their enclosin
g ancestor with an overflow clip. | |
| 44 There should be no red. | |
| 45 <div id="overflow"> | 52 <div id="overflow"> |
| 46 <div class="spacer"></div> | 53 <div class="spacer"></div> |
| 47 | 54 |
| 48 <div class="group" style="top: -120px"> | 55 <div class="group" style="top: -120px"> |
| 49 <div class="container"> | 56 <div class="container"> |
| 50 <div class="sticky box" style="top: 200px"></div> | 57 <div class="sticky box" style="top: 200px"></div> |
| 51 </div> | 58 </div> |
| 52 </div> | 59 </div> |
| 53 | 60 |
| 54 <div class="group" style="top: -20px"> | 61 <div class="group" style="top: -20px"> |
| 55 <div class="container"> | 62 <div class="container"> |
| 56 <div class="sticky box" style="top: 120px"></div> | 63 <div class="sticky box" style="top: 120px"></div> |
| 57 </div> | 64 </div> |
| 58 </div> | 65 </div> |
| 59 | 66 |
| 60 <div class="group" style="top: 120px"> | 67 <div class="group" style="top: 120px"> |
| 61 <div class="container"> | 68 <div class="container"> |
| 62 <div class="sticky box" style="top: 0"></div> | 69 <div class="sticky box" style="top: 0"></div> |
| 63 </div> | 70 </div> |
| 64 </div> | 71 </div> |
| 72 <div id="hash" class="hash" style="top: -1px;"> |
| 73 </div> |
| 74 </div> |
| 75 <div style="position: absolute; top: 560px;"> |
| 76 This test checks that sticky positioning when scrolled by fragment. |
| 77 There should be no red. |
| 65 </div> | 78 </div> |
| 66 </body> | 79 </body> |
| 67 </html> | 80 </html> |
| 81 |
| OLD | NEW |