[webkit-changes] [WebKit/WebKit] 70b513: [GTK][WPE] Use KeyboardScrollingAnimator for keybo...

Carlos Garcia Campos noreply at github.com
Tue Nov 22 02:20:50 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 70b513d37784d67b87416b6745b34eba28258b0a
      https://github.com/WebKit/WebKit/commit/70b513d37784d67b87416b6745b34eba28258b0a
  Author: Carlos Garcia Campos <cgarcia at igalia.com>
  Date:   2022-11-22 (Tue, 22 Nov 2022)

  Changed paths:
    M Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebCore/page/EventHandler.h
    M Source/WebCore/page/scrolling/ThreadedScrollingTreeScrollingNodeDelegate.cpp
    M Source/WebCore/page/scrolling/ThreadedScrollingTreeScrollingNodeDelegate.h
    M Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h
    M Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm
    M Source/WebCore/platform/KeyboardScrollingAnimator.cpp
    M Source/WebCore/platform/KeyboardScrollingAnimator.h
    M Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp
    M Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp
    M Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp
    M Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp

  Log Message:
  -----------
  [GTK][WPE] Use KeyboardScrollingAnimator for keyboard scrolling
https://bugs.webkit.org/show_bug.cgi?id=247949

Reviewed by Michael Catanzaro.

* Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml: Enable
EventHandlerDrivenSmoothKeyboardScrollingEnabled for GTK and WPE.
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::defaultKeyboardEventHandler): Handle PageUp/Down and Home/End keys.
(WebCore::EventHandler::defaultKeyboardScrollEventHandler): Helper to
start a keyboard scrolling for a default key event handler.
(WebCore::EventHandler::defaultPageUpDownEventHandler): Scroll by page.
(WebCore::EventHandler::defaultHomeEndEventHandler): Scroll by document.
(WebCore::EventHandler::defaultSpaceEventHandler): Do not scroll
recursively when doing smooth scrolling.
(WebCore::EventHandler::focusedScrollableAreaShouldUseSmoothKeyboardScrolling):
(WebCore::EventHandler::shouldUseSmoothKeyboardScrollingForFocusedScrollableArea):
(WebCore::EventHandler::keyboardScrollRecursively): Do not call
shouldUseSmoothKeyboardScrollingForFocusedScrollableArea() since it's
always checked by callers.
(WebCore::EventHandler::keyboardScroll): Added.
(WebCore::EventHandler::defaultArrowEventHandler): Use defaultKeyboardScrollEventHandler() to support the non smooth scrolling path.
(WebCore::EventHandler::focusedScrollableAreaUsesScrollSnap): Deleted.
* Source/WebCore/page/EventHandler.h:
* Source/WebCore/page/scrolling/ThreadedScrollingTreeScrollingNodeDelegate.cpp:
(WebCore::ThreadedScrollingTreeScrollingNodeDelegate::handleKeyboardScrollRequest): Moved from mac.
* Source/WebCore/page/scrolling/ThreadedScrollingTreeScrollingNodeDelegate.h:
* Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::handleKeyboardScrollRequest): Deleted.
* Source/WebCore/platform/KeyboardScrollingAnimator.cpp:
(WebCore::keyboardScrollingKeyForKeyboardEvent): Handler Home and End keys.
(WebCore::scrollDirectionForKeyboardEvent): Ditto.
(WebCore::scrollGranularityForKeyboardEvent): Ditto.
* Source/WebCore/platform/KeyboardScrollingAnimator.h: Add Home and End keys.
* Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode): Handle keypad keys.
* Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
(WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): Ditto.
* Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithKeyEvent): Do not propagate arrow keys to parent widgets.
* Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::performDefaultBehaviorForKeyEvent): Remove implementation, key events are not handled by EventHandler.

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




More information about the webkit-changes mailing list