[webkit-changes] [WebKit/WebKit] 5d64ca: [UnifiedPDF] Handle PDF annotations actions that r...

Sammy Gill noreply at github.com
Tue Feb 13 08:52:36 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5d64ca88eee23e4cb2fd828d581875dc6abf2192
      https://github.com/WebKit/WebKit/commit/5d64ca88eee23e4cb2fd828d581875dc6abf2192
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2024-02-13 (Tue, 13 Feb 2024)

  Changed paths:
    M Source/WebKit/Platform/spi/Cocoa/PDFKitSPI.h
    M Source/WebKit/Shared/Cocoa/PDFKitSoftLink.h
    M Source/WebKit/Shared/Cocoa/PDFKitSoftLink.mm
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm

  Log Message:
  -----------
  [UnifiedPDF] Handle PDF annotations actions that reset form fields.
https://bugs.webkit.org/show_bug.cgi?id=269122
rdar://problem/122680796

Reviewed by Tim Horton.

A certain type of PDF annotation action can reset various fields on a
form. PDFKit represents this type of action as a PDFKitActionResetForm.

Basically what we will do is check to see if an annotation has an action
associated with it and will handle it if it does. This first patch
supports the reset form action and will check to see if the action is
of that type when handling it. If it is, we will call into the
appropriate PDFKit SPI which will do the actual work for us.

Also, the PDF specification says that an action is composed of a type,
which specifies the type of action that it is, and a list of subsequent
actions that are supposed to be performed. So we need to handle this
scenario also by:
1.) Performing the action
2.) Store the subsequent actions on a stack in reverse order (so that
the first action is at the top of the stack).
We keep handling the action at the top of the stack until it is empty.

* Source/WebKit/Platform/spi/Cocoa/PDFKitSPI.h:
* Source/WebKit/Shared/Cocoa/PDFKitSoftLink.h:
* Source/WebKit/Shared/Cocoa/PDFKitSoftLink.mm:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::handleMouseEvent):
(WebKit::UnifiedPDFPlugin::handlePDFActionForAnnotation):

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




More information about the webkit-changes mailing list