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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <style>
4 body {
5 height: 1800px;
6 }
7 </style>
8 <body>
9 <script>
10 window.jsTestIsAsync = true;
11
12 description("This test scrolls by clicking in the scrollbar track.");
13
14 // Compute ScrollableArea::pageStep.
15 var pageStep = innerHeight * 0.875;
16 if (navigator.userAgent.indexOf("Mac OS X") >= 0)
17 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
18
19 onload = function() {
20 if (!window.eventSender || !window.internals) {
21 finishJSTest();
22 return;
23 }
24
25 // Turn on smooth scrolling.
26 internals.settings.setScrollAnimatorEnabled(true);
27
28 // Click in the vertical scrollbar track, below the thumb.
29 eventSender.mouseMoveTo(790, 280);
30 eventSender.mouseDown();
31 eventSender.mouseUp();
32
33 // A second click should have no effect since we will be under the thumb
34 // by the time the animation completes.
35 eventSender.mouseDown();
36 eventSender.mouseUp();
37
38 shouldBecomeEqual("scrollY", "pageStep", function() {
39 requestAnimationFrame(function() {
40 // Make sure we stopped here.
41 shouldBe("scrollY", "pageStep");
42 finishJSTest();
43 });
44 });
45 };
46 </script>
47 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698