8 background-color: blue;
11 <script src=
"../../resources/js-test.js"></script>
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");
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");
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");
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");
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");
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");
66 <div id=
"content"></div>