Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / scroll-behavior / main-frame-scroll-in-standards-mode.html
blobf25792f9d2067d481e98bc434c0fb2b7be8f52da
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 #content {
6 width: 7500px;
7 height: 7500px;
8 background-color: blue;
10 </style>
11 <script src="../../resources/js-test.js"></script>
12 <script>
13 onload = function() {
14 description('Test that calling scroll methods on the body element does not scroll the viewport in standards mode.');
15 debug('Test that "scroll" on the body element does not scroll');
16 document.body.scroll(100, 100);
17 shouldBe("document.body.scrollTop", "0");
18 shouldBe("document.body.scrollLeft", "0");
19 shouldBe("document.documentElement.scrollTop", "0");
20 shouldBe("document.documentElement.scrollLeft", "0");
22 debug('');
23 debug('Test that "scrollTo" on the body element does not scroll');
24 document.body.scrollTo(100, 100);
25 shouldBe("document.body.scrollTop", "0");
26 shouldBe("document.body.scrollLeft", "0");
27 shouldBe("document.documentElement.scrollTop", "0");
28 shouldBe("document.documentElement.scrollLeft", "0");
30 debug('');
31 debug('Test that "scrollBy" on the body element does not scroll');
32 document.body.scrollBy(100, 100);
33 shouldBe("document.body.scrollTop", "0");
34 shouldBe("document.body.scrollLeft", "0");
35 shouldBe("document.documentElement.scrollTop", "0");
36 shouldBe("document.documentElement.scrollLeft", "0");
38 debug('');
39 debug('Test that "scroll" on the document element scrolls');
40 document.documentElement.scroll(50, 100);
41 shouldBe("document.body.scrollTop", "0");
42 shouldBe("document.body.scrollLeft", "0");
43 shouldBe("document.documentElement.scrollTop", "100");
44 shouldBe("document.documentElement.scrollLeft", "50");
46 debug('');
47 debug('Test that "scrollTo" on the document element scrolls');
48 document.documentElement.scrollTo(450, 200);
49 shouldBe("document.body.scrollTop", "0");
50 shouldBe("document.body.scrollLeft", "0");
51 shouldBe("document.documentElement.scrollTop", "200");
52 shouldBe("document.documentElement.scrollLeft", "450");
54 debug('');
55 debug('Test that "scrollBy" on the document element scrolls');
56 document.documentElement.scrollBy(300, 100);
57 shouldBe("document.body.scrollTop", "0");
58 shouldBe("document.body.scrollLeft", "0");
59 shouldBe("document.documentElement.scrollTop", "300");
60 shouldBe("document.documentElement.scrollLeft", "750");
62 </script>
63 </head>
65 <body>
66 <div id="content"></div>
67 </body>
68 </html>