blob: 4e21a7faf5dfbcff65cb6a541fdd6aa3ed598a16 [file] [log] [blame]
simon.fraser@apple.com13d530e2016-09-06 21:18:06 +00001<html>
2 <head>
3 <style>
4 div {
5 width: 9999px;
6 height: 9999px;
7 }
8 </style>
9 <script src="../../../resources/js-test-pre.js"></script>
10 <script>
11 var scroller;
12 function runTest() {
13 description('Tests scrollTo/By(x,y) and scrollTo/By(scrollOptions) on the body in quirks mode.');
14
15 scroller = document.body;
16 setTimeout(function() {
17 scroller.scrollTo(20, 500);
18 shouldBe("scroller.scrollLeft", "20");
19 shouldBe("scroller.scrollTop", "500");
20 shouldBe("window.scrollX", "20");
21 shouldBe("window.scrollY", "500");
22
23 scroller.scrollBy(50, 60);
24 shouldBe("scroller.scrollLeft", "70");
25 shouldBe("scroller.scrollTop", "560");
26 shouldBe("window.scrollX", "70");
27 shouldBe("window.scrollY", "560");
28
29 scroller.scrollTo({ 'left' : 100, 'top' : 400 });
30 shouldBe("scroller.scrollLeft", "100");
31 shouldBe("scroller.scrollTop", "400");
32 shouldBe("window.scrollX", "100");
33 shouldBe("window.scrollY", "400");
34
35 scroller.scrollTo(0, 0);
36
37 finishJSTest();
38 }, 0);
39 }
40 var jsTestIsAsync = true;
41 </script>
42 </head>
43 <body onload="runTest()">
44 <div>
45 </div>
46 <script src="../../../resources/js-test-post.js"></script>
47 </body>
48</html>