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

Side by Side Diff: LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html

Issue 1277583003: Restore scale even if scroll is not restored (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use window.scroll{X,y} 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <style>
3 body {
4 height: 10000px;
5 width: 10000px;
6 }
7 </style>
8
9 <body></body>
10
11 <script src="../../../resources/testharness.js"></script>
12 <script src="../../../resources/testharnessreport.js"></script>
13 <script type="text/javascript">
14 'use strict';
15 async_test(function(t) {
16 window.addEventListener('load', t.step_func(function() {
17 document.body.offsetTop; // force layout
18 if (window.name != 'verification') {
19 assert_array_equals([window.innerWidth, window.innerHeight], [800, 600], 'initial page size is valid');
20 if (window.internals)
21 window.internals.setPageScaleFactor(2);
22 assert_array_equals([window.innerWidth, window.innerHeight], [400, 300], 'page is scaled');
23
24 history.scrollRestoration = 'manual';
25 window.scrollTo(100, 200);
26 assert_equals(history.scrollRestoration, 'manual');
27 assert_array_equals([window.scrollX, window.scrollY], [100, 200]);
28
29 setTimeout(function() {
30 window.name = 'verification';
31 window.location = "data:text/html,<script>history.back();</scr" + "ipt >";
32 }, 0);
33 } else {
34 assert_array_equals([window.innerWidth, window.innerHeight], [400, 300], 'page scale is restored');
35 assert_array_equals([window.scrollX, window.scrollY], [0, 0], 'scroll po sition is not restored');
36 // clean up
37 window.name = '';
38 if (window.internals)
39 setTimeout(function() {window.internals.setPageScaleFactor(1);}, 0);
40 t.done();
41 }
42 }));
43 }, 'Setting scrollRestoration to manual should not affect scale restoration');
44 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/history/scroll-restoration/scroll-restoration-push-replace.html ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698