Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: LayoutTests/fast/loader/scroll-position-restored-on-back-at-load-event.html

Issue 52893003: scrollTop and scrollLeft always 0 in DOMContentLoaded handler on a scrolled page (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/loader/scroll-position-restored-on-back-at-load-event-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../js/resources/js-test-pre.js"></script>
5 <script>
6 description('Test ensures that documentElement.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 navigat ion), documentElement.scrollTop/Left are set.
11
12 function init(evt) {
13 if (window.name == 'second/load') {
14 shouldBe('document.documentElement.scrollTop', '2000');
15 shouldBe('document.documentElement.scrollLeft', '1000');
16 window.name = "";
17
18 if (window.testRunner)
19 finishJSTest();
20 } else {
21 window.scrollTo(1000, 2000);
22
23 window.name = "second/load";
24 setTimeout('window.location = "data:text/html,<script>history.back() ;</scr" + "ipt>"', 0);
25 }
26 }
27
28 window.addEventListener('DOMContentLoaded', init, true);
29 window.onunload = function() {} // prevent caching
30
31 var jsTestIsAsync = true;
32 </script>
33 <body>
34 <div id="overflow" style='width: 9999px; height:9999px; float:left;'></d iv>
35 <h1 id='console'/>
36 </body>
37 <script src="../js/resources/js-test-post.js"></script>
38 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/loader/scroll-position-restored-on-back-at-load-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698