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

Side by Side Diff: LayoutTests/fast/loader/scroll-position-restoration-without-premature-clamping.html

Issue 1271143003: Fix scroll restoration clamping bug (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Notify progress tracker before trying to restore position Created 5 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/fast/loader/scroll-position-restoration-without-premature-clamping-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 <style>
3 /* Body is large enough to scroll but not enough to restore the scroll
4 position without clamping. */
5 body {
6 height: 2000px;
7 width: 2000px;
8 }
9 </style>
10
11 <div id='console'></div>
12
13 <script src="../../resources/js-test.js"></script>
14 <script>
15 jsTestIsAsync = true
16 setPrintTestResultsLazily();
17 description('Test ensures that frame scroll position is not prematurely ' +
18 'clamped and restored before load event fires.');
19
20 // Forcing layout causes the frame to attempt to restore scroll position if
21 // possible even before page loading is complete.
22 forceLayout();
23 debug('Scroll position should not be clamped and restored while frame is loading ');
24 shouldBe('document.scrollingElement.scrollLeft', '0');
25 shouldBe('document.scrollingElement.scrollTop', '0');
26
27 onload = function() {
28 if (window.name == 'verification') {
29 shouldBe('document.scrollingElement.scrollLeft', '5000');
30 shouldBe('document.scrollingElement.scrollTop', '5001');
31
32 window.name = "";
33 setTimeout(function(){ window.scrollTo(0, 0); }, 0);
34 finishJSTest();
35 } else {
36 window.scrollTo(5000, 5001);
37 shouldBe('document.scrollingElement.scrollLeft', '5000');
38 shouldBe('document.scrollingElement.scrollTop', '5001');
39 setTimeout(function(){
40 window.name = "verification";
41 window.location = "data:text/html,<script>history.back();</scr" + "i pt>";
42 }, 0);
43 }
44 }
45
46 function forceLayout () {
47 document.body.scrollTop;
48 }
49 </script>
50
51 <style>
52 body {
53 height: 9999px;
54 width: 9999px;
55 }
56 </style>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/loader/scroll-position-restoration-without-premature-clamping-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698