| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <script> | |
| 3 | |
| 4 // Navigation steps | |
| 5 // 1. loads this page and it has a horizontal scrollbar | |
| 6 // 2. Navigates to a data URL and navigates back | |
| 7 function verifyPage() | |
| 8 { | |
| 9 var result = (innerHeight === document.documentElement.offsetHeight) | |
| 10 ? "FAIL: Scrollbar did not appear" | |
| 11 : "PASS"; | |
| 12 document.body.innerHTML = result; | |
| 13 if (window.testRunner) | |
| 14 testRunner.notifyDone(); | |
| 15 } | |
| 16 | |
| 17 function navigateAwayAndBack() | |
| 18 { | |
| 19 // Simulate a link click to create a history entry | |
| 20 var evt = document.createEvent("MouseEvents"); | |
| 21 evt.initMouseEvent("click", true, true, window, | |
| 22 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
| 23 document.getElementById('anchor').dispatchEvent(evt); | |
| 24 } | |
| 25 | |
| 26 function runTestStep() | |
| 27 { | |
| 28 if (window.testRunner) { | |
| 29 testRunner.dumpAsText(); | |
| 30 testRunner.waitUntilDone(); | |
| 31 testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1); | |
| 32 } | |
| 33 window.setTimeout("navigateAwayAndBack()", 200); | |
| 34 } | |
| 35 | |
| 36 function onVerifyPage(evt) | |
| 37 { | |
| 38 // If pageshow is happening as result of navigation back then we proceed. | |
| 39 if (evt.persisted) | |
| 40 setTimeout("verifyPage()", 200); | |
| 41 } | |
| 42 | |
| 43 window.onpageshow = onVerifyPage; | |
| 44 </script> | |
| 45 <head> | |
| 46 <style type="text/css"> | |
| 47 <!-- | |
| 48 #content { | |
| 49 background: #fff; | |
| 50 position: absolute; | |
| 51 top: 2px; | |
| 52 left: 2px; | |
| 53 width: 1500px; | |
| 54 height: 1500px; | |
| 55 } | |
| 56 --> | |
| 57 </style> | |
| 58 </head> | |
| 59 <body onload='runTestStep()'> | |
| 60 <div id="content"> <a id='anchor' href='data:text/html,<body onload="history.bac
k()"></body>'>Where is the scrollbar?</a></div> | |
| 61 </body> | |
| 62 </html> | |
| OLD | NEW |