Chromium Code Reviews| 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: 25%; | |
| 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 // Force initial layout. | |
| 30 document.body.offsetHeight; | |
| 31 | |
| 32 var fixed = document.querySelector(".fixed"); | |
| 33 var box = document.querySelector(".box"); | |
| 34 fixed.style.height = "75%"; | |
| 35 | |
| 36 assert_equals(box.offsetTop, 350); | |
|
mstensho (USE GERRIT)
2016/10/19 18:24:30
This value depends on the viewport height, which i
skobes
2016/10/19 21:48:40
Good point, done.
| |
| 37 }, "Fixed-pos in abs-pos container updates children on height change."); | |
| 38 | |
| 39 </script> | |
| OLD | NEW |