OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script type="text/javascript"> | 3 <script type="text/javascript"> |
4 function test() { | 4 function test() { |
5 if (window.testRunner) { | 5 if (window.testRunner) { |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 | 7 |
8 window.scrollTo(0, 1000); | 8 window.scrollTo(0, 1000); |
9 | 9 |
10 var clickEvent = document.createEvent("HTMLEvents"); | 10 var clickEvent = document.createEvent("HTMLEvents"); |
11 clickEvent.initEvent("click", "true", "true"); | 11 clickEvent.initEvent("click", "true", "true"); |
12 | 12 |
13 var gotoTop = document.getElementById("gotoTop"); | 13 var gotoTop = document.getElementById("gotoTop"); |
14 gotoTop.dispatchEvent(clickEvent); | 14 gotoTop.dispatchEvent(clickEvent); |
15 | 15 |
16 document.write("<div>document.body.scrollTop: " + document.body.
scrollTop +"</div>"); | 16 document.write("<div>document.scrollingElement.scrollTop: " + do
cument.scrollingElement.scrollTop +"</div>"); |
17 } | 17 } |
18 } | 18 } |
19 </script> | 19 </script> |
20 </head> | 20 </head> |
21 <body onload="test()"> | 21 <body onload="test()"> |
22 When clicking the link "Goto Top" at the middle of the page, it should go he
re. | 22 When clicking the link "Goto Top" at the middle of the page, it should go he
re. |
23 <div style="height:1500px; width:500px; background:#ffddff"></div> | 23 <div style="height:1500px; width:500px; background:#ffddff"></div> |
24 <a id="gotoTop" name="gotoTop" href="#">Goto Top</a> | 24 <a id="gotoTop" name="gotoTop" href="#">Goto Top</a> |
25 <div style="height:3000px; width:500px; background:#ffffdd"></div> | 25 <div style="height:3000px; width:500px; background:#ffffdd"></div> |
26 <a name="youshouldnotfindme">Oops! Here is the bottom of the page.</a> | 26 <a name="youshouldnotfindme">Oops! Here is the bottom of the page.</a> |
27 <a id="" name="youshouldnotfindmeeither">Oops!</a> | 27 <a id="" name="youshouldnotfindmeeither">Oops!</a> |
28 <a name="">Oops!</a> | 28 <a name="">Oops!</a> |
29 </body> | 29 </body> |
30 </html> | 30 </html> |
OLD | NEW |