70 lines
2.1 KiB
HTML
70 lines
2.1 KiB
HTML
<html>
|
|
<head>
|
|
<script>
|
|
function test()
|
|
{
|
|
if (!window.testRunner)
|
|
return;
|
|
|
|
if (window.testRunner)
|
|
testRunner.dumpAsText();
|
|
|
|
// 1st test: iframes scrolled to top, top level document scrolled to bottom
|
|
// pageup in innermost iframe should scroll top level document up
|
|
window[0][0].scrollTo(0,0);
|
|
window[0].scrollTo(0,0);
|
|
window.scrollTo(0, document.body.offsetHeight);
|
|
var oldScrollTop = document.scrollingElement.scrollTop;
|
|
var focus1 = window[0][0].document.getElementById("focus1");
|
|
focus1.focus();
|
|
eventSender.keyDown("pageUp");
|
|
var test1Passed = false;
|
|
if (document.scrollingElement.scrollTop < oldScrollTop)
|
|
test1Passed = true;
|
|
|
|
// 2nd test: iframes scrolled to bottom, top level document scrolled to top
|
|
// pagedown in innermost iframe should scroll top level document down
|
|
window[0][0].scrollTo(0,window[0][0].document.body.offsetHeight);
|
|
window[0].scrollTo(0,window[0].document.body.offsetHeight);
|
|
window.scrollTo(0, 0);
|
|
oldScrollTop = document.scrollingElement.scrollTop
|
|
var focus2 = window[0][0].document.getElementById("focus2");
|
|
focus2.focus();
|
|
eventSender.keyDown("pageDown");
|
|
var test2Passed = false;
|
|
if (document.scrollingElement.scrollTop > oldScrollTop)
|
|
test2Passed = true;
|
|
|
|
printResults(test1Passed, test2Passed);
|
|
}
|
|
|
|
function printResults(test1Passed, test2Passed)
|
|
{
|
|
var console = document.createElement("div");
|
|
if (test1Passed)
|
|
console.innerHTML = "PASSED test 1";
|
|
else
|
|
console.innerHTML = "FAILED test 1";
|
|
console.innerHTML += "<br>";
|
|
if (test2Passed)
|
|
console.innerHTML += "PASSED test 2";
|
|
else
|
|
console.innerHTML += "FAILED test 2";
|
|
|
|
document.body.appendChild(console);
|
|
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="window.resizeTo(500,587); test();">
|
|
<div id="testDiv">
|
|
top
|
|
<br>
|
|
<div style="height:200px"></div>
|
|
<iframe id="frame" width="450px" height="235px" src="./resources/iframe-scroll-page-up-down-1.html"></iframe>
|
|
<div style="height:200px"></div>
|
|
bottom
|
|
</div>
|
|
</body>
|
|
</html>
|