Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Wheel event does not stop macOS smooth keyboard scroll
https://bugs.webkit.org/show_bug.cgi?id=244303 rdar://99101109 Reviewed by Tim Horton. Currently, if you enable EventHandlerDrivenSmoothKeyboardScrolling, scroll using the keyboard, then immediately after use the trackpad to scroll, the webpage will scroll back to the position where the keyboard scroll left off. This patch improves the smooth scroll setting so that a wheel event tells the KeyboardScrollingAnimator to stop scrolling. This adds a method to KeyboardScrollingAnimator, stopScrollingImmediately that can be called to stop the animation without taking the time To decelerate, which is what should happen when a wheel event Interrupts the keyboard scroll. * LayoutTests/fast/scrolling/mac/keyboard-scrolling-with-mouse-scroll.html: * Source/WebCore/platform/KeyboardScrollingAnimator.cpp (WebCore::KeyboardScrollingAnimator::stopScrollingImmediately): * Source/WebCore/platform/KeyboardScrollingAnimator.h * Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp Canonical link: https://commits.webkit.org/254561@main
- Loading branch information
Showing
5 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
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,5 @@ | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Successful. | ||
|
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,43 @@ | ||
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true EventHandlerDrivenSmoothKeyboardScrollingEnabled=true ] --> | ||
|
||
<html> | ||
|
||
<head> | ||
<script src="../../../resources/ui-helper.js"></script> | ||
<script src="../../../resources/js-test.js"></script> | ||
<meta name="viewport" content="initial-scale=1.5, user-scalable=no"> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
async function runTest() | ||
{ | ||
if (!window.testRunner || !testRunner.runUIScript) | ||
return; | ||
|
||
await UIHelper.rawKeyDown("downArrow"); | ||
|
||
setTimeout(async () => { | ||
await UIHelper.rawKeyUp("downArrow"); | ||
await UIHelper.mouseWheelScrollAt(10, 10, 0, 1, 0, 10); | ||
|
||
const position = window.scrollY; | ||
if (position <= 1) | ||
debug("Successful."); | ||
else | ||
debug("Unsuccessful. window.scrollY == " + position); | ||
|
||
testRunner.notifyDone(); | ||
}, 100); | ||
} | ||
</script> | ||
</head> | ||
|
||
<body onload="runTest()"> | ||
<div style="height: 5000px;"> | ||
</div> | ||
</body> | ||
|
||
</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
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