[webkit-changes] [WebKit/WebKit] 6ade66: [UnifiedPDF] Documents should be saved with modifi...

Sammy Gill noreply at github.com
Wed Feb 7 18:22:25 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6ade66019ba329793f0851d597827c5430cefd8a
      https://github.com/WebKit/WebKit/commit/6ade66019ba329793f0851d597827c5430cefd8a
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2024-02-07 (Wed, 07 Feb 2024)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm

  Log Message:
  -----------
  [UnifiedPDF] Documents should be saved with modified annotations.
https://bugs.webkit.org/show_bug.cgi?id=268923
rdar://119632592

Reviewed by Tim Horton.

When returning the document's data to save it we have two different
options: we can either return the data from the resource that was loaded
or we returning the data from PDFKit. We would want to return the former
so that documents that cannot be loaded by PDFKit can be saved and the
latter when the PDF was mutated. In order to determine which one we want
to use we need to keep track of when the PDF was mutated. This can be
done by hooking up an observer that will listen for events that are
sent by the PDFDocument when an annotation changed. This observer will
then modify some state to indicate that this occurred and which we will
consult when returning the document data.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(-[WKPDFFormMutationObserver initWithPlguin:]):
(-[WKPDFFormMutationObserver formChanged:]):
(WebKit::UnifiedPDFPlugin::UnifiedPDFPlugin):
(WebKit::mutationObserverNotificationString):
(WebKit::UnifiedPDFPlugin::teardown):
(WebKit::UnifiedPDFPlugin::installPDFDocument):
(WebKit::UnifiedPDFPlugin::liveResourceData const):
(WebKit::UnifiedPDFPlugin::liveData const):

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




More information about the webkit-changes mailing list