[webkit-changes] [WebKit/WebKit] 3ce9b3: [UnifiedPDF] Allow WKImmediateActionController to ...

Abrar Rahman Protyasha noreply at github.com
Thu Feb 15 05:39:17 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3ce9b3d1133f25e8fecc81788cded923b4bb7a99
      https://github.com/WebKit/WebKit/commit/3ce9b3d1133f25e8fecc81788cded923b4bb7a99
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
    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
    M Source/WebKit/WebProcess/Plugins/PluginView.h
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm

  Log Message:
  -----------
  [UnifiedPDF] Allow WKImmediateActionController to hit test on UnifiedPDFPlugin
https://bugs.webkit.org/show_bug.cgi?id=269433
rdar://122990495

Reviewed by Tim Horton.

Any hit testing WebPage::performImmediateActionHitTestAtLocation would
do on the PDF plugin was being compiled away for UnifiedPDFPlugin,
notably because we had not implemented the rectForSelectionInRootView and
lookupTextAtLocation methods on UnifiedPDFPlugin yet.

This patch addresses this issue by implementing the required lookup
methods on UnifiedPDFPlugin and putting the relevant lookup calls behind
ENABLE(PDF_PLUGIN) instead of ENABLE(LEGACY_PDFKIT_PLUGIN) in
performImmediateActionHitTestAtLocation.

We take the liberty to move away from a std::pair to a named struct for
the return type of lookupTextAtLocation, and we also remove its const
qualifier. The latter is necessary so that the plugin can update its
current selection, if required.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::lookupTextAtLocation):
(WebKit:: const): Deleted.
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::convertFromRootViewToDocument const):
(WebKit::UnifiedPDFPlugin::convertFromPageToRootView const):
(WebKit::UnifiedPDFPlugin::existingSelectionContainsPoint const):
(WebKit::UnifiedPDFPlugin::rectForSelectionInRootView const):
(WebKit::UnifiedPDFPlugin::lookupTextAtLocation):
(WebKit:: const): Deleted.
* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::lookupTextAtLocation const):
(WebKit:: const): Deleted.
* Source/WebKit/WebProcess/Plugins/PluginView.h:
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performImmediateActionHitTestAtLocation):

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




More information about the webkit-changes mailing list