OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 |
| 3 <html> |
| 4 <head> |
| 5 <style> |
| 6 #overflow { |
| 7 width: 600px; |
| 8 height: 600px; |
| 9 overflow: hidden; /* Still scrollable with JS */ |
| 10 border: 1px solid black; |
| 11 } |
| 12 |
| 13 .group { |
| 14 position: relative; |
| 15 width: 500px; |
| 16 height: 200px; |
| 17 } |
| 18 |
| 19 .container { |
| 20 width: 400px; |
| 21 height: 180px; |
| 22 outline: 2px solid black; |
| 23 } |
| 24 |
| 25 .box { |
| 26 width: 200px; |
| 27 height: 180px; |
| 28 } |
| 29 |
| 30 .sticky { |
| 31 position: sticky; |
| 32 left: 100px; |
| 33 right: 200px; |
| 34 background-color: green; |
| 35 } |
| 36 |
| 37 .indicator { |
| 38 position: absolute; |
| 39 top: 0; |
| 40 left: 0; |
| 41 background-color: red; |
| 42 } |
| 43 </style> |
| 44 <script> |
| 45 function doTest() |
| 46 { |
| 47 document.getElementById('overflow').scrollLeft = 100; |
| 48 } |
| 49 window.addEventListener('load', doTest, false); |
| 50 </script> |
| 51 </head> |
| 52 <body> |
| 53 This test checks that right offset is ignored with overconstrained sticky positi
oning and ltr text direction. |
| 54 There should be no red. |
| 55 <div id="overflow"> |
| 56 <div class="group"> |
| 57 <div class="indicator box" style="left: 200px;"></div> |
| 58 <div class="container"> |
| 59 <div class="sticky box"></div> |
| 60 </div> |
| 61 </div> |
| 62 |
| 63 <div class="group" style="left: 100px"> |
| 64 <div class="indicator box" style="left: 100px;"></div> |
| 65 <div class="container"> |
| 66 <div class="sticky box"></div> |
| 67 </div> |
| 68 </div> |
| 69 |
| 70 <div class="group" style="left: 200px"> |
| 71 <div class="indicator box" style="left: 0;"></div> |
| 72 <div class="container"> |
| 73 <div class="sticky box"></div> |
| 74 </div> |
| 75 </div> |
| 76 </div> |
| 77 </body> |
| 78 </html> |
OLD | NEW |