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 body { height: 1400px; } | |
| 7 body.shrink { height: 1000px; } | |
| 8 | |
| 9 #anchor { | |
| 10 display: block; | |
| 11 position: absolute; | |
| 12 width: 100px; | |
| 13 height: 100px; | |
| 14 background-color: #fdd; | |
| 15 left: 200px; | |
| 16 top: 600px; | |
| 17 } | |
| 18 | |
| 19 body.shrink > #anchor { | |
| 20 top: 200px; | |
| 21 } | |
| 22 | |
| 23 </style> | |
| 24 <a id="anchor" name="foo"></a> | |
| 25 <script> | |
| 26 | |
| 27 test(function(t) { | |
| 28 location.hash = "#foo"; | |
| 29 assert_equals(scrollY, 600); | |
| 30 document.body.className = "shrink"; | |
|
bokan
2016/11/03 11:19:12
This both shrinks the body and moves the <a>. Mayb
skobes
2016/11/03 13:31:42
Done.
| |
| 31 assert_equals(scrollY, 200); | |
| 32 }, "Preserve fragment anchor if clamping occurs during load."); | |
| 33 | |
| 34 </script> | |
| OLD | NEW |