| Index: third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/history-restore-anchors.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/history-restore-anchors.html b/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/history-restore-anchors.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..649073657cd5fe80b2b14a5a063ea2be7ead0b03
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/history-restore-anchors.html
|
| @@ -0,0 +1,53 @@
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| +<style>
|
| + body {
|
| + margin: 0px;
|
| + height: 2000px;
|
| + width: 2000px;
|
| + }
|
| +
|
| + #first {
|
| + height: 1000px;
|
| + background-color: #FFA5D2;
|
| + }
|
| +
|
| + #anchor {
|
| + position: absolute;
|
| + background-color: #84BE6A;
|
| + height: 600px;
|
| + width: 100%;
|
| + }
|
| +</style>
|
| +
|
| +<div id="first"></div>
|
| +<div id="changer"></div>
|
| +<div id="anchor"></div>
|
| +
|
| +<script>
|
| + // Navigation steps:
|
| + // 1- page gets loaded and anchor element gets scrolled into view.
|
| + // 2- loaded page refreshed.
|
| + async_test(function(t) {
|
| + // TODO(ymalik): Remove reference to internals when scroll anchoring is
|
| + // enabled by default.
|
| + assert_false(!window.internals, 'This test requires internals');
|
| + internals.runtimeFlags.scrollAnchoringEnabled = true;
|
| +
|
| + if (window.name == 'second/load') {
|
| + assert_equals(window.scrollY, 1000);
|
| + // Change height of content above anchor.
|
| + var ch = document.getElementById('changer');
|
| + ch.style.height = 100;
|
| + // Height of first + height changer.
|
| + assert_equals(window.scrollY, 1100)
|
| + t.done();
|
| + } else {
|
| + var anchor = document.getElementById('anchor');
|
| + anchor.scrollIntoView();
|
| + assert_equals(window.scrollY, 1000);
|
| + window.name = "second/load";
|
| + window.location.reload();
|
| + }
|
| + }, 'Verify scroll anchoring interaction with history restoration');
|
| +</script>
|
|
|