[webkit-changes] [WebKit/WebKit] 657d45: [UnifiedPDF] Keyboard scrolling has no effect

Tim Horton noreply at github.com
Wed Jan 10 17:06:21 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 657d45347d8c7eb8757b150eb473ab10fbb3c96f
      https://github.com/WebKit/WebKit/commit/657d45347d8c7eb8757b150eb473ab10fbb3c96f
  Author: Tim Horton <thorton at apple.com>
  Date:   2024-01-10 (Wed, 10 Jan 2024)

  Changed paths:
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebCore/page/EventHandler.h
    M Source/WebCore/page/LocalFrame.h
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
    M Source/WebKit/WebProcess/Plugins/PluginView.cpp

  Log Message:
  -----------
  [UnifiedPDF] Keyboard scrolling has no effect
https://bugs.webkit.org/show_bug.cgi?id=267356
rdar://118414971

Reviewed by Richard Robinson.

Because UnifiedPDFPlugin is somewhat odd in keeping its own ScrollableArea,
we have a small bit of plumbing to do to make keyboard scrolling work, as follows:

* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::startKeyboardScrollAnimationOnDocument):
When we have no focused element, if the relevant document is a PluginDocument,
see if the plugin wants to handle keyboard scrolling.

(WebCore::EventHandler::startKeyboardScrollAnimationOnEnclosingScrollableContainer):
If the focused element is a plugin, see if the plugin wants to handle keyboard scrolling.

(WebCore::EventHandler::startKeyboardScrollAnimationOnPlugin):
For plugins with internal async scrollers, give the plugin a shot at keyboard scrolling.

* Source/WebCore/page/EventHandler.h:
* Source/WebCore/page/LocalFrame.h:

* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::handleEditingCommand):
(WebKit::PDFPlugin::isEditingCommandEnabled):
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
Fix the types of these methods to match their friends in WebPage.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::requestStartKeyboardScrollAnimation):
(WebKit::UnifiedPDFPlugin::requestStopKeyboardScrollAnimation):
Implement these ScrollableArea methods and forward them to the page's ScrollingCoordinator.

(WebKit::UnifiedPDFPlugin::handleEditingCommand):
(WebKit::UnifiedPDFPlugin::isEditingCommandEnabled):
Implement these editing commands and forward them to the page's Editor.
They'll come back around eventually.

* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::handleEditingCommand):
Pass the editing command argument along to the plugin for completeness' sake.

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




More information about the webkit-changes mailing list