[webkit-changes] [WebKit/WebKit] 768a90: Keyboard scroll doesn't stop after pressing down a...

Richard Robinson noreply at github.com
Mon Jul 31 09:59:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 768a90b9b462c18ff01d2a58b8ac14693a8afd6b
      https://github.com/WebKit/WebKit/commit/768a90b9b462c18ff01d2a58b8ac14693a8afd6b
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2023-07-31 (Mon, 31 Jul 2023)

  Changed paths:
    A LayoutTests/fast/scrolling/mac/keyboard-scroll-stops-with-keyup-prevented-expected.txt
    A LayoutTests/fast/scrolling/mac/keyboard-scroll-stops-with-keyup-prevented.html
    M Source/WebCore/page/EventHandler.cpp

  Log Message:
  -----------
  Keyboard scroll doesn't stop after pressing down arrow if `keyup` is default prevented
https://bugs.webkit.org/show_bug.cgi?id=259623
rdar://112396756

Reviewed by Tim Horton.

If a page prevents the default handling of the `keyup` event, but not `keydown`, a keyboard
scroll will be able to be started, but will never end because `EventHandler::defaultKeyboardEventHandler`
will never get called.

Fix by preemptively handling `keyup` in `EventHandler::internalKeyEvent` so that keyboard scrolls
will always be properly terminated even if the event is default-prevented.

* LayoutTests/fast/scrolling/mac/keyboard-scroll-stops-with-keyup-prevented-expected.txt: Added.
* LayoutTests/fast/scrolling/mac/keyboard-scroll-stops-with-keyup-prevented.html: Added.
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::internalKeyEvent):
(WebCore::EventHandler::defaultKeyboardEventHandler):

Canonical link: https://commits.webkit.org/266425@main




More information about the webkit-changes mailing list