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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/scroll-behavior/main-frame-scroll-in-quirks-mode.html
diff --git a/LayoutTests/fast/scroll-behavior/main-frame-scroll-in-quirks-mode.html b/LayoutTests/fast/scroll-behavior/main-frame-scroll-in-quirks-mode.html
new file mode 100644
index 0000000000000000000000000000000000000000..bbf45c5590617d2af73668231842d9a4a2f9d63d
--- /dev/null
+++ b/LayoutTests/fast/scroll-behavior/main-frame-scroll-in-quirks-mode.html
@@ -0,0 +1,68 @@
+<html>
+<head>
+ <style>
+ #content {
+ width: 7500px;
+ height: 7500px;
+ background-color: blue;
+ }
+ </style>
+ <script src="../../resources/js-test.js"></script>
+ <script>
+ onload = function() {
+ description('Test that calling scroll methods on the body element scrolls the viewport in quirks mode');
+
+ debug('Test that "scroll" on the document element does not scroll');
+ document.documentElement.scroll(100, 100);
+ shouldBe("document.documentElement.scrollTop", "0");
+ shouldBe("document.documentElement.scrollLeft", "0");
+ shouldBe("document.body.scrollTop", "0");
+ shouldBe("document.body.scrollLeft", "0");
+
+ debug('');
+ debug('Test that "scrollTo" on the document element does not scroll');
+ document.documentElement.scrollTo(100, 100);
+ shouldBe("document.documentElement.scrollTop", "0");
+ shouldBe("document.documentElement.scrollLeft", "0");
+ shouldBe("document.body.scrollTop", "0");
+ shouldBe("document.body.scrollLeft", "0");
+
+ debug('');
+ debug('Test that "scrollBy" on the document element does not scroll');
+ document.documentElement.scrollBy(100, 100);
+ shouldBe("document.documentElement.scrollTop", "0");
+ shouldBe("document.documentElement.scrollLeft", "0");
+ shouldBe("document.body.scrollTop", "0");
+ shouldBe("document.body.scrollLeft", "0");
+
+ debug('');
+ debug('Test that "scroll" on the body element scrolls');
+ document.body.scroll(50, 100);
+ shouldBe("document.documentElement.scrollTop", "0");
+ shouldBe("document.documentElement.scrollLeft", "0");
+ shouldBe("document.body.scrollTop", "100");
+ shouldBe("document.body.scrollLeft", "50");
+
+ debug('');
+ debug('Test that "scrollTo" on the body element scrolls');
+ document.body.scrollTo(450, 200);
+ shouldBe("document.documentElement.scrollTop", "0");
+ shouldBe("document.documentElement.scrollLeft", "0");
+ shouldBe("document.body.scrollTop", "200");
+ shouldBe("document.body.scrollLeft", "450");
+
+ debug('');
+ debug('Test that "scrollBy" on the body element scrolls');
+ document.body.scrollBy(300, 100);
+ shouldBe("document.documentElement.scrollTop", "0");
+ shouldBe("document.documentElement.scrollLeft", "0");
+ shouldBe("document.body.scrollTop", "300");
+ shouldBe("document.body.scrollLeft", "750");
+ }
+ </script>
+</head>
+
+<body>
+ <div id="content"></div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698