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 } else { | |
yoichio
2015/03/11 04:16:52
Above if statement ends with return so we don't ne
pals
2015/03/11 06:09:28
Done.
| |
18 var input = document.getElementById("text-input"); | |
19 input.focus(); | |
20 if (window.eventSender) | |
21 eventSender.keyDown("a"); | |
17 } | 22 } |
18 | 23 |
19 setTimeout(function () { | 24 setTimeout(function () { |
20 var scrollPosition = document.body.scrollTop; | 25 var scrollPosition = document.body.scrollTop; |
21 var result = document.getElementById("result"); | 26 var result = document.getElementById("result"); |
22 if (scrollPosition == 100) | 27 if (scrollPosition != 100) |
23 result.innerHTML = "Success! The scroll position was restored after navigation." | 28 result.innerHTML = "Success! The scroll position in history was not restored after navigation as input field is revealed on selection." |
24 if (window.testRunner) | 29 if (window.testRunner) |
25 testRunner.notifyDone(); | 30 testRunner.notifyDone(); |
26 }, 0); | 31 }, 0); |
27 } | 32 } |
28 | 33 |
29 </script> | 34 </script> |
30 </head> | 35 </head> |
31 <body style="width:800px" onpageshow="navigate();"> | 36 <body style="width:800px" onpageshow="navigate();"> |
32 <div id="result">Fail. The scroll position was not restored after navigation .</div><br/><br/> | 37 <input id="text-input" type="text"/> |
33 <div style="width:600; height:1000; background-color:purple;"></div> | 38 <div id="result">Fail. The scroll position in history was restored after nav igation.</div><br/><br/> |
39 <div style="width:600; height:1200; background-color:purple;"></div> | |
34 </body> | 40 </body> |
35 </htmL> | 41 </htmL> |
OLD | NEW |