[webkit-changes] [WebKit/WebKit] f3426a: Keyboard scrolling in WebKit with Page Up / Down i...

Richard Robinson noreply at github.com
Fri Mar 31 22:21:51 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f3426a32f875f4109c07a83d596f9e29539ad46e
      https://github.com/WebKit/WebKit/commit/f3426a32f875f4109c07a83d596f9e29539ad46e
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2023-03-31 (Fri, 31 Mar 2023)

  Changed paths:
    M Source/WebCore/editing/EditorCommand.cpp
    M Source/WebCore/page/EventHandler.h
    M Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm

  Log Message:
  -----------
  Keyboard scrolling in WebKit with Page Up / Down is no longer smooth
https://bugs.webkit.org/show_bug.cgi?id=254624
rdar://107214002

Reviewed by Simon Fraser.

In `executeScrollPageForward` and `executeScrollPageBackward`, the check for `isKeyRepeat` would
always return `false`, since the passed in `Event*` was always `nullptr`. Therefore, keyboard
scrolling with Page Up or Page Down would not use the new smooth keyboard scrolling mechanism.

This PR fixes this by propogating a bool value in `EventHandler` if the associated event is a key
repeat or not. This information is passed in `executeKeypressCommandsInternal`, which is then read
within the `executeScrollPage*` functions (and then immediately reset to preserve state).

* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeScrollPageBackward):
(WebCore::executeScrollPageForward):
* Source/WebCore/page/EventHandler.h:
(WebCore::EventHandler::setProcessingKeyRepeatForPotentialScroll):
(WebCore::EventHandler::isProcessingKeyRepeatForPotentialScroll const):
* Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::executeKeypressCommandsInternal):

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




More information about the webkit-changes mailing list