OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 |
| 6 .fixed { |
| 7 left: 100px; |
| 8 width: 600px; |
| 9 height: 200px; |
| 10 position: fixed; |
| 11 } |
| 12 .box { |
| 13 position: absolute; |
| 14 bottom: 0; |
| 15 width: 600px; |
| 16 height: 100px; |
| 17 background: lightblue; |
| 18 } |
| 19 |
| 20 </style> |
| 21 <div style="position: absolute"> |
| 22 <div class="fixed"> |
| 23 <div class="box"></div> |
| 24 </div> |
| 25 </div> |
| 26 <script> |
| 27 |
| 28 test(() => { |
| 29 var fixed = document.querySelector(".fixed"); |
| 30 var box = document.querySelector(".box"); |
| 31 |
| 32 assert_equals(box.offsetTop, 100); |
| 33 |
| 34 fixed.style.height = "400px"; |
| 35 assert_equals(box.offsetTop, 300); |
| 36 }, "Fixed-pos in abs-pos container updates children on height change."); |
| 37 |
| 38 </script> |
OLD | NEW |