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

Side by Side Diff: LayoutTests/fast/scroll-behavior/main-frame-scroll-in-standards-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 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 #content {
6 width: 7500px;
7 height: 7500px;
8 background-color: blue;
9 }
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
16 debug('Test that "scroll" on the body element does not scroll');
17 document.body.scroll(100, 100);
18 shouldBe("document.body.scrollTop", "0");
19 shouldBe("document.body.scrollLeft", "0");
20 shouldBe("document.documentElement.scrollTop", "0");
21 shouldBe("document.documentElement.scrollLeft", "0");
22
23 debug('');
24 debug('Test that "scrollTo" on the body element does not scroll');
25 document.body.scrollTo(100, 100);
26 shouldBe("document.body.scrollTop", "0");
27 shouldBe("document.body.scrollLeft", "0");
28 shouldBe("document.documentElement.scrollTop", "0");
29 shouldBe("document.documentElement.scrollLeft", "0");
30
31 debug('');
32 debug('Test that "scrollBy" on the body element does not scroll');
33 document.body.scrollBy(100, 100);
34 shouldBe("document.body.scrollTop", "0");
35 shouldBe("document.body.scrollLeft", "0");
36 shouldBe("document.documentElement.scrollTop", "0");
37 shouldBe("document.documentElement.scrollLeft", "0");
38
39 debug('');
40 debug('Test that "scroll" on the document element scrolls');
41 document.documentElement.scroll(50, 100);
42 shouldBe("document.body.scrollTop", "0");
43 shouldBe("document.body.scrollLeft", "0");
44 shouldBe("document.documentElement.scrollTop", "100");
45 shouldBe("document.documentElement.scrollLeft", "50");
46
47 debug('');
48 debug('Test that "scrollTo" on the document element scrolls');
49 document.documentElement.scrollTo(450, 200);
50 shouldBe("document.body.scrollTop", "0");
51 shouldBe("document.body.scrollLeft", "0");
52 shouldBe("document.documentElement.scrollTop", "200");
53 shouldBe("document.documentElement.scrollLeft", "450");
54
55 debug('');
56 debug('Test that "scrollBy" on the document element scrolls');
57 document.documentElement.scrollBy(300, 100);
58 shouldBe("document.body.scrollTop", "0");
59 shouldBe("document.body.scrollLeft", "0");
60 shouldBe("document.documentElement.scrollTop", "300");
61 shouldBe("document.documentElement.scrollLeft", "750");
62 }
63 </script>
64 </head>
65
66 <body>
67 <div id="content"></div>
68 </body>
69 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698