| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script> | |
| 4 | |
| 5 function navigate() | |
| 6 { | |
| 7 if (location.hash == "") { | |
| 8 if (window.testRunner) { | |
| 9 testRunner.dumpAsText(); | |
| 10 testRunner.waitUntilDone(); | |
| 11 } | |
| 12 | |
| 13 scrollTo(0,100); | |
| 14 history.pushState({ }, "", window.location + "#1"); | |
| 15 setTimeout("window.location.href = 'resources/empty-document-goes-back.h
tml'", 0); | |
| 16 return; | |
| 17 } | |
| 18 | |
| 19 setTimeout(function () { | |
| 20 var scrollPosition = document.body.scrollTop; | |
| 21 var result = document.getElementById("result"); | |
| 22 if (scrollPosition == 100) | |
| 23 result.innerHTML = "Success! The scroll position was restored after
navigation." | |
| 24 if (window.testRunner) | |
| 25 testRunner.notifyDone(); | |
| 26 }, 0); | |
| 27 } | |
| 28 | |
| 29 </script> | |
| 30 </head> | |
| 31 <body style="width:800px" onpageshow="navigate();"> | |
| 32 <div id="result">Fail. The scroll position was not restored after navigation
.</div><br/><br/> | |
| 33 <div style="width:600; height:1000; background-color:purple;"></div> | |
| 34 </body> | |
| 35 </htmL> | |
| OLD | NEW |