This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix smooth scroll overshooting when mouse held down in scrollbar track.
Scrollbar::autoscrollPressedPart now checks if the mouse is under the thumb's eventual (target) position, rather than its current position. BUG=578554 Review URL: https://codereview.chromium.org/1601303003 Cr-Commit-Position: refs/heads/master@{#370285}
- Loading branch information
1 parent
c705f32
commit ef53ba3
Showing
10 changed files
with
89 additions
and
16 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This test scrolls by clicking in the scrollbar track. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS scrollY became pageStep | ||
PASS scrollY is pageStep | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
47 changes: 47 additions & 0 deletions
47
third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
|
||
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters