[webkit-changes] [WebKit/WebKit] 3bfd75: [UnifiedPDF] Find in PDF without overlays

Sammy Gill noreply at github.com
Wed Feb 14 12:03:15 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3bfd7513a9aff5e2ae3f35fbf1547843adf0306a
      https://github.com/WebKit/WebKit/commit/3bfd7513a9aff5e2ae3f35fbf1547843adf0306a
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2024-02-14 (Wed, 14 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/PDFDocumentLayout.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm

  Log Message:
  -----------
  [UnifiedPDF] Find in PDF without overlays
https://bugs.webkit.org/show_bug.cgi?id=269328
rdar://problem/122917321

Reviewed by Tim Horton.

Provides the initial support for the find in PDF functionality. This
is done by querying the PDFDocument for the string that was passed in
for search.

In order to accomplish this we need to keep track of the last string
that was searched for. If the target string is the same as the last one
then we need to continue the search from the last match/result we found.
We keep track of the results as the current selection. If the target is
not as the last string we found, then we need to clear the selection
before we attempt to search for the string.

When we find the string we will update its selection to the one that
was returned to us from PDFDocument and potentially scroll to it if it
is currently out of view.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm:
(WebKit::PDFDocumentLayout::pdfPageRectToDocumentRect const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::convertFromPageToDocument const):
(WebKit::UnifiedPDFPlugin::convertFromPageToContents const):
(WebKit::UnifiedPDFPlugin::countFindMatches):
(WebKit::UnifiedPDFPlugin::findString):

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




More information about the webkit-changes mailing list