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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html
diff --git a/LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html b/LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html
new file mode 100644
index 0000000000000000000000000000000000000000..6d076424005b5d67837681807debf6c4e8af1971
--- /dev/null
+++ b/LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<style>
+ body {
+ height: 10000px;
+ width: 10000px;
+ }
+</style>
+
+<body></body>
+
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script type="text/javascript">
+ 'use strict';
+ async_test(function(t) {
+ window.addEventListener('load', t.step_func(function() {
+ document.body.offsetTop; // force layout
+ if (window.name != 'verification') {
+ assert_array_equals([window.innerWidth, window.innerHeight], [800, 600], 'initial page size is valid');
+ if (window.internals)
+ window.internals.setPageScaleFactor(2);
+ assert_array_equals([window.innerWidth, window.innerHeight], [400, 300], 'page is scaled');
+
+ history.scrollRestoration = 'manual';
+ window.scrollTo(100, 200);
+ assert_equals(history.scrollRestoration, 'manual');
+ assert_array_equals([window.scrollX, window.scrollY], [100, 200]);
+
+ setTimeout(function() {
+ window.name = 'verification';
+ window.location = "data:text/html,<script>history.back();</scr" + "ipt>";
+ }, 0);
+ } else {
+ assert_array_equals([window.innerWidth, window.innerHeight], [400, 300], 'page scale is restored');
+ assert_array_equals([window.scrollX, window.scrollY], [0, 0], 'scroll position is not restored');
+ // clean up
+ window.name = '';
+ if (window.internals)
+ setTimeout(function() {window.internals.setPageScaleFactor(1);}, 0);
+ t.done();
+ }
+ }));
+ }, 'Setting scrollRestoration to manual should not affect scale restoration');
+</script>
« 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