| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 description('Test ensures that scrollingElement.scrollTop/Left properties ar
e available by the time DOMContentLoaded event fires.'); | 6 description('Test ensures that scrollingElement.scrollTop/Left properties ar
e available by the time DOMContentLoaded event fires.'); |
| 7 // Navigation steps: | 7 // Navigation steps: |
| 8 // 1- page gets first loaded and scrolled. | 8 // 1- page gets first loaded and scrolled. |
| 9 // 2- loaded page away and then 'back'. | 9 // 2- loaded page away and then 'back'. |
| 10 // Test: ensure that by the time DOMContenLoaded fires (after a back navigat
ion), scrollingElement.scrollTop/Left are set. | 10 // Test: ensure that by the time DOMContenLoaded fires (after a back navigat
ion), scrollingElement.scrollTop/Left are set. |
| 11 | 11 |
| 12 function init(evt) { | 12 function init(evt) { |
| 13 if (window.name == 'second/load') { | 13 if (window.name == 'second/load') { |
| 14 shouldBe('document.scrollingElement.scrollTop', '2000'); | 14 shouldBe('document.scrollingElement.scrollTop', '2000'); |
| 15 shouldBe('document.scrollingElement.scrollLeft', '1000'); | 15 shouldBe('document.scrollingElement.scrollLeft', '1000'); |
| 16 window.name = ""; | 16 window.name = ""; |
| 17 | 17 |
| 18 if (window.testRunner) | 18 if (window.testRunner) |
| 19 finishJSTest(); | 19 finishJSTest(); |
| 20 } else { | 20 } else { |
| 21 window.scrollTo(1000, 2000); | 21 window.scrollTo(1000, 2000); |
| 22 | 22 |
| 23 window.name = "second/load"; | 23 window.name = "second/load"; |
| 24 } | 24 } |
| 25 } | 25 } |
| 26 function onLoad() { | 26 function onLoad() { |
| 27 setTimeout('window.location = "data:text/html,<script>history.back();</s
cr" + "ipt>"', 0); | 27 setTimeout('window.location = "../../resources/back.html"', 0); |
| 28 } | 28 } |
| 29 | 29 |
| 30 window.addEventListener('DOMContentLoaded', init, true); | 30 window.addEventListener('DOMContentLoaded', init, true); |
| 31 window.onunload = function() {} // prevent caching | 31 window.onunload = function() {} // prevent caching |
| 32 | 32 |
| 33 var jsTestIsAsync = true; | 33 var jsTestIsAsync = true; |
| 34 </script> | 34 </script> |
| 35 <body onload="onLoad()"> | 35 <body onload="onLoad()"> |
| 36 <div id="overflow" style='width: 9999px; height:9999px; float:left;'></d
iv> | 36 <div id="overflow" style='width: 9999px; height:9999px; float:left;'></d
iv> |
| 37 <h1 id='console'/> | 37 <h1 id='console'/> |
| 38 </body> | 38 </body> |
| 39 </html> | 39 </html> |
| OLD | NEW |