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

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

Issue 1133693002: Update most LayoutTests to be agnostic to scrollTopLeftInterop mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tdresser cr feedback Created 5 years, 7 months 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 <script> 5 <script>
6 description('Test ensures that body.scrollTop/Left properties are available by the time DOMContentLoaded event fires.'); 6 description('Test ensures that scrollingElement.scrollTop/Left properties ar e available by the time DOMContentLoaded event fires.');
7 // Navigation steps: 7 // Navigation steps:
8 // 1- page gets first loaded and scrolled. 8 // 1- page gets first loaded and scrolled.
9 // 2- reload is performed. 9 // 2- reload is performed.
10 // Test: ensure that by the time DOMContenLoaded fires (after a reload navig ation), body.scrollTop/Left are set. 10 // Test: ensure that by the time DOMContenLoaded fires (after a reload navig ation), scrollingElement.scrollTop/Left are set.
11 11
12 function init(evt) { 12 function init(evt) {
13 if (window.name == 'second/load') { 13 if (window.name == 'second/load') {
14 shouldBe('document.body.scrollTop', '2000'); 14 shouldBe('document.scrollingElement.scrollTop', '2000');
15 shouldBe('document.body.scrollLeft', '1000'); 15 shouldBe('document.scrollingElement.scrollLeft', '1000');
16 window.name = ""; 16 window.name = "";
17 17
18 if (window.testRunner) 18 if (window.testRunner)
19 finishJSTest(); 19 finishJSTest();
20 } else { 20 } else {
21 window.scrollTo(1000, 2000); 21 window.scrollTo(1000, 2000);
22 22
23 window.name = "second/load"; 23 window.name = "second/load";
24 setTimeout('location.reload(true)', 0); 24 setTimeout('location.reload(true)', 0);
25 } 25 }
26 } 26 }
27 27
28 window.addEventListener('DOMContentLoaded', init, true); 28 window.addEventListener('DOMContentLoaded', init, true);
29 window.onunload = function() {} // prevent caching 29 window.onunload = function() {} // prevent caching
30 30
31 var jsTestIsAsync = true; 31 var jsTestIsAsync = true;
32 </script> 32 </script>
33 <body> 33 <body>
34 <div style='width: 9999px; height:9999px; float:left;'></div> 34 <div style='width: 9999px; height:9999px; float:left;'></div>
35 <h1 id='console'/> 35 <h1 id='console'/>
36 </body> 36 </body>
37 </html> 37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698