| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script> | 3 <script> |
| 4 function test() | 4 function test() |
| 5 { | 5 { |
| 6 if (!window.testRunner) | 6 if (!window.testRunner) |
| 7 return; | 7 return; |
| 8 | 8 |
| 9 if (window.testRunner) | 9 if (window.testRunner) |
| 10 testRunner.dumpAsText(); | 10 testRunner.dumpAsText(); |
| 11 | 11 |
| 12 // 1st test: iframes scrolled to top, top level document scrolled to bottom | 12 // 1st test: iframes scrolled to top, top level document scrolled to bottom |
| 13 // pageup in innermost iframe should scroll top level document up | 13 // pageup in innermost iframe should scroll top level document up |
| 14 window[0][0].scrollTo(0,0); | 14 window[0][0].scrollTo(0,0); |
| 15 window[0].scrollTo(0,0); | 15 window[0].scrollTo(0,0); |
| 16 window.scrollTo(0, document.body.offsetHeight); | 16 window.scrollTo(0, document.body.offsetHeight); |
| 17 var oldScrollTop = document.body.scrollTop; | 17 var oldScrollTop = document.scrollingElement.scrollTop; |
| 18 var focus1 = window[0][0].document.getElementById("focus1"); | 18 var focus1 = window[0][0].document.getElementById("focus1"); |
| 19 focus1.focus(); | 19 focus1.focus(); |
| 20 eventSender.keyDown("pageUp"); | 20 eventSender.keyDown("pageUp"); |
| 21 var test1Passed = false; | 21 var test1Passed = false; |
| 22 if (document.body.scrollTop < oldScrollTop) | 22 if (document.scrollingElement.scrollTop < oldScrollTop) |
| 23 test1Passed = true; | 23 test1Passed = true; |
| 24 | 24 |
| 25 // 2nd test: iframes scrolled to bottom, top level document scrolled to top | 25 // 2nd test: iframes scrolled to bottom, top level document scrolled to top |
| 26 // pagedown in innermost iframe should scroll top level document down | 26 // pagedown in innermost iframe should scroll top level document down |
| 27 window[0][0].scrollTo(0,window[0][0].document.body.offsetHeight); | 27 window[0][0].scrollTo(0,window[0][0].document.body.offsetHeight); |
| 28 window[0].scrollTo(0,window[0].document.body.offsetHeight); | 28 window[0].scrollTo(0,window[0].document.body.offsetHeight); |
| 29 window.scrollTo(0, 0); | 29 window.scrollTo(0, 0); |
| 30 oldScrollTop = document.body.scrollTop | 30 oldScrollTop = document.scrollingElement.scrollTop |
| 31 var focus2 = window[0][0].document.getElementById("focus2"); | 31 var focus2 = window[0][0].document.getElementById("focus2"); |
| 32 focus2.focus(); | 32 focus2.focus(); |
| 33 eventSender.keyDown("pageDown"); | 33 eventSender.keyDown("pageDown"); |
| 34 var test2Passed = false; | 34 var test2Passed = false; |
| 35 if (document.body.scrollTop > oldScrollTop) | 35 if (document.scrollingElement.scrollTop > oldScrollTop) |
| 36 test2Passed = true; | 36 test2Passed = true; |
| 37 | 37 |
| 38 printResults(test1Passed, test2Passed); | 38 printResults(test1Passed, test2Passed); |
| 39 } | 39 } |
| 40 | 40 |
| 41 function printResults(test1Passed, test2Passed) | 41 function printResults(test1Passed, test2Passed) |
| 42 { | 42 { |
| 43 var console = document.createElement("div"); | 43 var console = document.createElement("div"); |
| 44 if (test1Passed) | 44 if (test1Passed) |
| 45 console.innerHTML = "PASSED test 1"; | 45 console.innerHTML = "PASSED test 1"; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 60 <div id="testDiv"> | 60 <div id="testDiv"> |
| 61 top | 61 top |
| 62 <br> | 62 <br> |
| 63 <div style="height:200px"></div> | 63 <div style="height:200px"></div> |
| 64 <iframe id="frame" width="450px" height="235px" src="./resources/iframe-scroll-p
age-up-down-1.html"></iframe> | 64 <iframe id="frame" width="450px" height="235px" src="./resources/iframe-scroll-p
age-up-down-1.html"></iframe> |
| 65 <div style="height:200px"></div> | 65 <div style="height:200px"></div> |
| 66 bottom | 66 bottom |
| 67 </div> | 67 </div> |
| 68 </body> | 68 </body> |
| 69 </html> | 69 </html> |
| OLD | NEW |