3 <script type=
"text/javascript">
5 if (window
.testRunner
) {
6 testRunner
.dumpAsText();
8 window
.scrollTo(0, 1000);
10 var clickEvent
= document
.createEvent("HTMLEvents");
11 clickEvent
.initEvent("click", "true", "true");
13 var gotoTop
= document
.getElementById("gotoTop");
14 gotoTop
.dispatchEvent(clickEvent
);
16 document
.write("<div>document.scrollingElement.scrollTop: " + document
.scrollingElement
.scrollTop
+"</div>");
21 <body onload=
"test()">
22 When clicking the link
"Goto Top" at the middle of the page, it should go here.
23 <div style=
"height:1500px; width:500px; background:#ffddff"></div>
24 <a id=
"gotoTop" name=
"gotoTop" href=
"#">Goto Top
</a>
25 <div style=
"height:3000px; width:500px; background:#ffffdd"></div>
26 <a name=
"youshouldnotfindme">Oops! Here is the bottom of the page.
</a>
27 <a id=
"" name=
"youshouldnotfindmeeither">Oops!
</a>