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