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

Unified Diff: LayoutTests/fast/scroll-behavior/overflow-scrollLeft.html

Issue 134443003: Implement CSSOM Smooth Scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 10 months 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/overflow-scrollLeft.html
diff --git a/LayoutTests/fast/scroll-behavior/overflow-scrollLeft.html b/LayoutTests/fast/scroll-behavior/overflow-scrollLeft.html
new file mode 100644
index 0000000000000000000000000000000000000000..86437a95d993c048c1cb848fd1d11a7d2a277fea
--- /dev/null
+++ b/LayoutTests/fast/scroll-behavior/overflow-scrollLeft.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ #container {
+ width: 200px;
+ height: 200px;
+ overflow: scroll;
+ }
+
+ #content {
+ width: 7500px;
+ height: 7500px;
+ background-color: blue;
+ }
+ </style>
+ <script src="../../resources/testharness.js"></script>
+ <script src="../../resources/testharnessreport.js"></script>
+ <script src="resources/scroll-behavior-test.js"></script>
+ <script type="text/javascript">
+ const instantScrolls = [
+ {js: "instant", css: "instant", x: 1},
+ {js: "instant", css: "smooth", x: 2},
+ {js: "auto", css: "instant", x: 3},
+ {js: "", css: "instant", x: 4}
+ ];
+
+ const smoothScrolls = [
+ {js: "smooth", css: "instant", waitForEnd: true, x: 10},
+ {js: "smooth", css: "smooth", waitForEnd: true, x: 20},
+ {js: "auto", css: "smooth", waitForEnd: true, x: 30},
+ {js: "", css: "smooth", waitForEnd: true, x: 40},
+ {js: "smooth", css: "instant", waitForEnd: false, x: 4000},
+ {js: "smooth", css: "smooth", waitForEnd: false, x: 15},
+ {js: "auto", css: "smooth", waitForEnd: false, x: 4100},
+ {js: "", css: "smooth", waitForEnd: false, x: 10},
+ ];
+
+ function runTestCase(testCase)
+ {
+ var element = document.getElementById("container");
+ if (testCase.js)
+ element.scrollLeft = {x: testCase.x, behavior: testCase.js};
+ else
+ element.scrollLeft = testCase.x;
+ }
+
+ function endX(testCase)
+ {
+ return testCase.x;
+ }
+
+ function endY(testCase, startY)
+ {
+ return startY;
+ }
+
+ function doTest()
+ {
+ var element = document.getElementById("container");
+ runScrollBehaviorTests(element,
+ element,
+ instantScrolls,
+ smoothScrolls,
+ runTestCase,
+ endX,
+ endY);
+ }
+
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+
+<body>
+ <p>Test that setting scrollLeft on an overflow:scroll element works with both scroll behaviors</p>
+ <div id="container">
+ <div id="content"></div>
+ </div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698