| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 |
| 6 body { margin: 0; } |
| 7 .rel { position: relative; } |
| 8 .abs { position: absolute; } |
| 9 .fix { position: fixed; } |
| 10 |
| 11 </style> |
| 12 <div class="rel"> |
| 13 <div class="abs"> |
| 14 <div class="fix">fixed</div> |
| 15 </div> |
| 16 </div> |
| 17 <script> |
| 18 |
| 19 test(() => { |
| 20 var abs = document.querySelector(".abs"); |
| 21 var fix = document.querySelector(".fix"); |
| 22 |
| 23 assert_equals(fix.offsetTop, 0); |
| 24 |
| 25 abs.style.top = "100px"; |
| 26 assert_equals(fix.offsetTop, 100); |
| 27 }, "Abs-pos in rel-pos container updates fixed-pos child when moved."); |
| 28 |
| 29 </script> |
| OLD | NEW |