summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/loader/scroll-restore-on-back-ordering.html
blob: 37fa0e8cc30a9acfcc548546c673c23f50fe7dec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<body>
<div style="height: 1000px"></div>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

window.onpopstate = function() {
    console.log("popstate " + window.scrollY);
}

window.onhashchange = function() {
    console.log("hashchanged " + window.scrollY);
    if (window.testRunner)
        testRunner.notifyDone();
}

window.onload = function() {
    setTimeout(function() {
        window.scrollTo(0, 1000);
        history.pushState({ }, '', '#a');
        window.scrollTo(0, 0);
        history.back();
    }, 0);
}

</script>
</body>