Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / loader / scroll-position-restored-on-back-at-load-event.html
blob9a5dd277661371325782ea924c4c408b4f1979a3
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script>
6 description('Test ensures that scrollingElement.scrollTop/Left properties are available by the time DOMContentLoaded event fires.');
7 // Navigation steps:
8 // 1- page gets first loaded and scrolled.
9 // 2- loaded page away and then 'back'.
10 // Test: ensure that by the time DOMContenLoaded fires (after a back navigation), scrollingElement.scrollTop/Left are set.
12 function init(evt) {
13 if (window.name == 'second/load') {
14 shouldBe('document.scrollingElement.scrollTop', '2000');
15 shouldBe('document.scrollingElement.scrollLeft', '1000');
16 window.name = "";
18 if (window.testRunner)
19 finishJSTest();
20 } else {
21 window.scrollTo(1000, 2000);
23 window.name = "second/load";
24 setTimeout('window.location = "data:text/html,<script>history.back();</scr" + "ipt>"', 0);
28 window.addEventListener('DOMContentLoaded', init, true);
29 window.onunload = function() {} // prevent caching
31 var jsTestIsAsync = true;
32 </script>
33 <body>
34 <div id="overflow" style='width: 9999px; height:9999px; float:left;'></div>
35 <h1 id='console'/>
36 </body>
37 </html>