OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <style> |
| 3 body { |
| 4 height: 2000px; |
| 5 width: 2000px; |
| 6 } |
| 7 </style> |
| 8 |
| 9 <script src="../../../resources/testharness.js"></script> |
| 10 <script src="../../../resources/testharnessreport.js"></script> |
| 11 <script type="text/javascript"> |
| 12 'use strict'; |
| 13 |
| 14 test(function() { |
| 15 assert_true(history.scrollRestoration !== undefined, 'history.scrollRestorat
ion exists'); |
| 16 }, 'Basic existence'); |
| 17 |
| 18 test(function() { |
| 19 assert_equals(history.scrollRestoration, 'auto'); |
| 20 }, 'Default value is "auto"'); |
| 21 |
| 22 test(function() { |
| 23 history.scrollRestoration = 'manual'; |
| 24 assert_equals(history.scrollRestoration, 'manual', 'should be able to set "m
anual"'); |
| 25 history.scrollRestoration = 'auto'; |
| 26 assert_equals(history.scrollRestoration, 'auto', 'should be able to set "aut
o"'); |
| 27 }, 'It is writable'); |
| 28 |
| 29 test(function() { |
| 30 history.scrollRestoration = 'auto'; |
| 31 for (var v of[3.1415, {}, 'bogus']) { |
| 32 history.scrollRestoration = v; |
| 33 assert_equals(history.scrollRestoration, 'auto', `setting to invalid value
(${v}) should be ignored`); |
| 34 } |
| 35 }, 'Invalid values are ignored'); |
| 36 </script> |
OLD | NEW |