Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: LayoutTests/fast/scroll-behavior/main-frame-scroll-in-quirks-mode.html

Issue 782793002: Update Element API for CSSOM smooth scrolling to match the spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <style>
4 #content {
5 width: 7500px;
6 height: 7500px;
7 background-color: blue;
8 }
9 </style>
10 <script src="../../resources/js-test.js"></script>
11 <script>
12 onload = function() {
13 description('Test that calling scroll methods on the body element scrolls the viewport in quirks mode');
14
15 debug('Test that "scroll" on the document element does not scroll');
16 document.documentElement.scroll(100, 100);
17 shouldBe("document.documentElement.scrollTop", "0");
18 shouldBe("document.documentElement.scrollLeft", "0");
19 shouldBe("document.body.scrollTop", "0");
20 shouldBe("document.body.scrollLeft", "0");
21
22 debug('');
23 debug('Test that "scrollTo" on the document element does not scroll');
24 document.documentElement.scrollTo(100, 100);
25 shouldBe("document.documentElement.scrollTop", "0");
26 shouldBe("document.documentElement.scrollLeft", "0");
27 shouldBe("document.body.scrollTop", "0");
28 shouldBe("document.body.scrollLeft", "0");
29
30 debug('');
31 debug('Test that "scrollBy" on the document element does not scroll');
32 document.documentElement.scrollBy(100, 100);
33 shouldBe("document.documentElement.scrollTop", "0");
34 shouldBe("document.documentElement.scrollLeft", "0");
35 shouldBe("document.body.scrollTop", "0");
36 shouldBe("document.body.scrollLeft", "0");
37
38 debug('');
39 debug('Test that "scroll" on the body element scrolls');
40 document.body.scroll(50, 100);
41 shouldBe("document.documentElement.scrollTop", "0");
42 shouldBe("document.documentElement.scrollLeft", "0");
43 shouldBe("document.body.scrollTop", "100");
44 shouldBe("document.body.scrollLeft", "50");
45
46 debug('');
47 debug('Test that "scrollTo" on the body element scrolls');
48 document.body.scrollTo(450, 200);
49 shouldBe("document.documentElement.scrollTop", "0");
50 shouldBe("document.documentElement.scrollLeft", "0");
51 shouldBe("document.body.scrollTop", "200");
52 shouldBe("document.body.scrollLeft", "450");
53
54 debug('');
55 debug('Test that "scrollBy" on the body element scrolls');
56 document.body.scrollBy(300, 100);
57 shouldBe("document.documentElement.scrollTop", "0");
58 shouldBe("document.documentElement.scrollLeft", "0");
59 shouldBe("document.body.scrollTop", "300");
60 shouldBe("document.body.scrollLeft", "750");
61 }
62 </script>
63 </head>
64
65 <body>
66 <div id="content"></div>
67 </body>
68 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698