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> |