| OLD | NEW |
| (Empty) | |
| 1 <script src="../../../resources/testharness.js"></script> |
| 2 <script src="../../../resources/testharnessreport.js"></script> |
| 3 <style> |
| 4 body { |
| 5 margin: 0px; |
| 6 height: 2000px; |
| 7 width: 2000px; |
| 8 } |
| 9 |
| 10 #first { |
| 11 height: 1000px; |
| 12 background-color: #FFA5D2; |
| 13 } |
| 14 |
| 15 #anchor { |
| 16 position: absolute; |
| 17 background-color: #84BE6A; |
| 18 height: 600px; |
| 19 width: 100%; |
| 20 } |
| 21 |
| 22 #fragment { |
| 23 position: relative; |
| 24 background-color: orange; |
| 25 height: 200px; |
| 26 width: 200px; |
| 27 margin: 10px; |
| 28 } |
| 29 </style> |
| 30 |
| 31 <div id="first"></div> |
| 32 <div id="changer"></div> |
| 33 <div id="anchor"> |
| 34 <div id="fragment" name="fragment"></div> |
| 35 </div> |
| 36 |
| 37 <script> |
| 38 test(function(t) { |
| 39 // Note that this test passes even without scroll anchoring because of |
| 40 // fragment anchoring. |
| 41 window.location.hash = 'fragment'; |
| 42 // Height of first + fragment margin-top. |
| 43 assert_equals(window.scrollY, 1010); |
| 44 |
| 45 // Change height of content above fragment. |
| 46 var ch = document.getElementById('changer'); |
| 47 ch.style.height = 100; |
| 48 |
| 49 // Height of first + height changer + fragment margin-top. |
| 50 assert_equals(window.scrollY, 1110); |
| 51 }, 'Verify scroll anchoring interaction with fragment scrolls'); |
| 52 </script> |
| OLD | NEW |