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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/scroll-behavior/main-frame-scroll-in-standards-mode.html
diff --git a/LayoutTests/fast/scroll-behavior/main-frame-scroll-in-standards-mode.html b/LayoutTests/fast/scroll-behavior/main-frame-scroll-in-standards-mode.html
new file mode 100644
index 0000000000000000000000000000000000000000..0e530f169ad0ade12641ef18ddd098ad27e80149
--- /dev/null
+++ b/LayoutTests/fast/scroll-behavior/main-frame-scroll-in-standards-mode.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<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 does not scroll the viewport in standards mode');
+
+ debug('Test that "scroll" on the body element does not scroll');
+ document.body.scroll(100, 100);
+ shouldBe("document.body.scrollTop", "0");
+ shouldBe("document.body.scrollLeft", "0");
+ shouldBe("document.documentElement.scrollTop", "0");
+ shouldBe("document.documentElement.scrollLeft", "0");
+
+ debug('');
+ debug('Test that "scrollTo" on the body element does not scroll');
+ document.body.scrollTo(100, 100);
+ shouldBe("document.body.scrollTop", "0");
+ shouldBe("document.body.scrollLeft", "0");
+ shouldBe("document.documentElement.scrollTop", "0");
+ shouldBe("document.documentElement.scrollLeft", "0");
+
+ debug('');
+ debug('Test that "scrollBy" on the body element does not scroll');
+ document.body.scrollBy(100, 100);
+ shouldBe("document.body.scrollTop", "0");
+ shouldBe("document.body.scrollLeft", "0");
+ shouldBe("document.documentElement.scrollTop", "0");
+ shouldBe("document.documentElement.scrollLeft", "0");
+
+ debug('');
+ debug('Test that "scroll" on the document element scrolls');
+ document.documentElement.scroll(50, 100);
+ shouldBe("document.body.scrollTop", "0");
+ shouldBe("document.body.scrollLeft", "0");
+ shouldBe("document.documentElement.scrollTop", "100");
+ shouldBe("document.documentElement.scrollLeft", "50");
+
+ debug('');
+ debug('Test that "scrollTo" on the document element scrolls');
+ document.documentElement.scrollTo(450, 200);
+ shouldBe("document.body.scrollTop", "0");
+ shouldBe("document.body.scrollLeft", "0");
+ shouldBe("document.documentElement.scrollTop", "200");
+ shouldBe("document.documentElement.scrollLeft", "450");
+
+ debug('');
+ debug('Test that "scrollBy" on the document element scrolls');
+ document.documentElement.scrollBy(300, 100);
+ shouldBe("document.body.scrollTop", "0");
+ shouldBe("document.body.scrollLeft", "0");
+ shouldBe("document.documentElement.scrollTop", "300");
+ shouldBe("document.documentElement.scrollLeft", "750");
+ }
+ </script>
+</head>
+
+<body>
+ <div id="content"></div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698