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

Unified Diff: third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll.html

Issue 1601303003: Fix smooth scroll overshooting when mouse held down in scrollbar track. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll.html
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll.html b/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll.html
new file mode 100644
index 0000000000000000000000000000000000000000..1b90c01a0257329f1e9f909dcc6b3e08f63c8c19
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+body {
+ height: 1800px;
+}
+</style>
+<body>
+<script>
+window.jsTestIsAsync = true;
+
+description("This test scrolls by clicking in the scrollbar track.");
+
+// Compute ScrollableArea::pageStep.
+var pageStep = innerHeight * 0.875;
+if (navigator.userAgent.indexOf("Mac OS X") >= 0)
+ pageStep = Math.max(pageStep, innerHeight - 40);
jbroman 2016/01/19 22:39:12 Unfortunate to have this hard-coded in a layout te
skobes 2016/01/19 23:44:14 In theory we could expose it through window.intern
+
+onload = function() {
+ if (!window.eventSender || !window.internals) {
+ finishJSTest();
+ return;
+ }
+
+ // Turn on smooth scrolling.
+ internals.settings.setScrollAnimatorEnabled(true);
+
+ // Click in the vertical scrollbar track, below the thumb.
+ eventSender.mouseMoveTo(790, 280);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+
+ // A second click should have no effect since we will be under the thumb
+ // by the time the animation completes.
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+
+ shouldBecomeEqual("scrollY", "pageStep", function() {
+ requestAnimationFrame(function() {
+ // Make sure we stopped here.
+ shouldBe("scrollY", "pageStep");
+ finishJSTest();
+ });
+ });
+};
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698