| <!DOCTYPE html> |
| <script src="../../../resources/testharness.js"></script> |
| <script src="../../../resources/testharnessreport.js"></script> |
| <style> |
| |
| .fixed { |
| left: 100px; |
| width: 600px; |
| height: 200px; |
| position: fixed; |
| } |
| .box { |
| position: absolute; |
| bottom: 0; |
| width: 600px; |
| height: 100px; |
| background: lightblue; |
| } |
| |
| </style> |
| <div style="position: absolute"> |
| <div class="fixed"> |
| <div class="box"></div> |
| </div> |
| </div> |
| <script> |
| |
| test(() => { |
| var fixed = document.querySelector(".fixed"); |
| var box = document.querySelector(".box"); |
| |
| assert_equals(box.offsetTop, 100); |
| |
| fixed.style.height = "400px"; |
| assert_equals(box.offsetTop, 300); |
| }, "Fixed-pos in abs-pos container updates children on height change."); |
| |
| </script> |