Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/loader/clamping-preserves-fragment-anchor.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/loader/clamping-preserves-fragment-anchor.html b/third_party/WebKit/LayoutTests/fast/loader/clamping-preserves-fragment-anchor.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..64e8e239096db982c818abe4a1a08685589002d5 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/loader/clamping-preserves-fragment-anchor.html |
| @@ -0,0 +1,34 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<style> |
| + |
| +body { height: 1400px; } |
| +body.shrink { height: 1000px; } |
| + |
| +#anchor { |
| + display: block; |
| + position: absolute; |
| + width: 100px; |
| + height: 100px; |
| + background-color: #fdd; |
| + left: 200px; |
| + top: 600px; |
| +} |
| + |
| +body.shrink > #anchor { |
| + top: 200px; |
| +} |
| + |
| +</style> |
| +<a id="anchor" name="foo"></a> |
| +<script> |
| + |
| +test(function(t) { |
| + location.hash = "#foo"; |
| + assert_equals(scrollY, 600); |
| + 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.
|
| + assert_equals(scrollY, 200); |
| +}, "Preserve fragment anchor if clamping occurs during load."); |
| + |
| +</script> |