[webkit-changes] [WebKit/WebKit] e0038b: [UnifiedPDF] Start handling text widget annotations.

Sammy Gill noreply at github.com
Wed Jan 24 17:16:09 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e0038b5b7ace4173ca4547fbbf9f4e124dec0675
      https://github.com/WebKit/WebKit/commit/e0038b5b7ace4173ca4547fbbf9f4e124dec0675
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2024-01-24 (Wed, 24 Jan 2024)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginAnnotation.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] Start handling text widget annotations.
https://bugs.webkit.org/show_bug.cgi?id=267967
rdar://problem/121474907

Reviewed by Simon Fraser.

To start handling text annotations, we start by handling mouse left
clicks. When doing this we check to see if there is an annotation under
the left click event and if is a text annotation widget. If this is the
case then we will set the active annotation to this one (making sure
to commit any other previously active annotation).

The PDFPluginAnnotation that is created will need the bounds for the
underlying annotation to properly style the HTML input element that is
used. This is a matter of getting the bounds from the annotation, which
is in page space, and then converting it into document space. Before
this patch the PDFPluginAnnotation was performing this conversion, but
I moved this responsibility to the PDFPlugins instead so that the
annotations can just do everything in document space.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::boundsForAnnotation const):
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
(WebKit::PDFPluginAnnotation::updateGeometry):
* 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::indexForPage const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::UnifiedPDFPlugin):
(WebKit::documentSpaceToPageSpaceTransform):
(WebKit::UnifiedPDFPlugin::convertFromDocumentToPage const):
(WebKit::UnifiedPDFPlugin::convertFromPageToDocument const):
(WebKit::UnifiedPDFPlugin::handleMouseEvent):
(WebKit::UnifiedPDFPlugin::boundsForAnnotation const):
(WebKit::UnifiedPDFPlugin::setActiveAnnotation):

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




More information about the webkit-changes mailing list