6 if (!window.testRunner)
10 testRunner.dumpAsText();
12 // 1st test: iframes scrolled to top, top level document scrolled to bottom
13 // pageup in innermost iframe should scroll top level document up
14 window[0][0].scrollTo(0,0);
15 window[0].scrollTo(0,0);
16 window.scrollTo(0, document.body.offsetHeight);
17 var oldScrollTop = document.scrollingElement.scrollTop;
18 var focus1 = window[0][0].document.getElementById("focus1");
20 eventSender.keyDown("pageUp");
21 var test1Passed = false;
22 if (document.scrollingElement.scrollTop < oldScrollTop)
25 // 2nd test: iframes scrolled to bottom, top level document scrolled to top
26 // pagedown in innermost iframe should scroll top level document down
27 window[0][0].scrollTo(0,window[0][0].document.body.offsetHeight);
28 window[0].scrollTo(0,window[0].document.body.offsetHeight);
29 window.scrollTo(0, 0);
30 oldScrollTop = document.scrollingElement.scrollTop
31 var focus2 = window[0][0].document.getElementById("focus2");
33 eventSender.keyDown("pageDown");
34 var test2Passed = false;
35 if (document.scrollingElement.scrollTop > oldScrollTop)
38 printResults(test1Passed, test2Passed);
41 function printResults(test1Passed, test2Passed)
43 var console = document.createElement("div");
45 console.innerHTML = "PASSED test 1";
47 console.innerHTML = "FAILED test 1";
48 console.innerHTML += "<br>";
50 console.innerHTML += "PASSED test 2";
52 console.innerHTML += "FAILED test 2";
54 document.body.appendChild(console);
59 <body onload="window.resizeTo(500,587); test();">
63 <div style="height:200px"></div>
64 <iframe id="frame" width="450px" height="235px" src="./resources/iframe-scroll-page-up-down-1.html"></iframe>
65 <div style="height:200px"></div>