From 3ed0f4e841a4a7adf1243ced93eb72604c7bb501 Mon Sep 17 00:00:00 2001 From: Richard Robinson Date: Tue, 20 Sep 2022 11:11:00 -0700 Subject: [PATCH] `KeyboardScrollingAnimator::updateKeyboardScrollPosition` is called indefinitely when using keyboard smooth scrolling https://bugs.webkit.org/show_bug.cgi?id=245403 rdar://100146415 Reviewed by Tim Horton and Simon Fraser. When the `EventHandler driven smooth scrolling` flag is enabled, `KeyboardScrollingAnimator::updateKeyboardScrollPosition` is called indefinitely, causing the scroll to never terminate. Regression from https://github.com/WebKit/WebKit/commit/8c822fa15adbdecd22d0c3ece07c9e9aa2260af1 which accidentally removed the logic of settng `m_scrollTriggeringKeyIsPressed` to `false`. * Source/WebCore/platform/KeyboardScrollingAnimator.cpp: (WebCore::KeyboardScrollingAnimator::handleKeyUpEvent): Canonical link: https://commits.webkit.org/254685@main --- ...keyboard-scrolling-terminates-expected.txt | 4 +++ .../mac/keyboard-scrolling-terminates.html | 36 +++++++++++++++++++ .../platform/KeyboardScrollingAnimator.cpp | 1 + 3 files changed, 41 insertions(+) create mode 100644 LayoutTests/fast/scrolling/mac/keyboard-scrolling-terminates-expected.txt create mode 100644 LayoutTests/fast/scrolling/mac/keyboard-scrolling-terminates.html diff --git a/LayoutTests/fast/scrolling/mac/keyboard-scrolling-terminates-expected.txt b/LayoutTests/fast/scrolling/mac/keyboard-scrolling-terminates-expected.txt new file mode 100644 index 000000000000..43e5eeedbf1b --- /dev/null +++ b/LayoutTests/fast/scrolling/mac/keyboard-scrolling-terminates-expected.txt @@ -0,0 +1,4 @@ +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/scrolling/mac/keyboard-scrolling-terminates.html b/LayoutTests/fast/scrolling/mac/keyboard-scrolling-terminates.html new file mode 100644 index 000000000000..a05728c9211d --- /dev/null +++ b/LayoutTests/fast/scrolling/mac/keyboard-scrolling-terminates.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + +
+
+ + + diff --git a/Source/WebCore/platform/KeyboardScrollingAnimator.cpp b/Source/WebCore/platform/KeyboardScrollingAnimator.cpp index 3bf93ff573ce..ffa4bf954ba6 100644 --- a/Source/WebCore/platform/KeyboardScrollingAnimator.cpp +++ b/Source/WebCore/platform/KeyboardScrollingAnimator.cpp @@ -343,6 +343,7 @@ void KeyboardScrollingAnimator::handleKeyUpEvent() return; stopKeyboardScrollAnimation(); + m_scrollTriggeringKeyIsPressed = false; } void KeyboardScrollingAnimator::stopScrollingImmediately()