[webkit-changes] [WebKit/WebKit] 7208a1: [UnifiedPDF] When an incremental PDF completes its...
Simon Fraser
noreply at github.com
Thu May 9 17:56:26 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7208a15cb4af909a38d444b9e4aaf1c56fb013bd
https://github.com/WebKit/WebKit/commit/7208a15cb4af909a38d444b9e4aaf1c56fb013bd
Author: Simon Fraser <simon.fraser at apple.com>
Date: 2024-05-09 (Thu, 09 May 2024)
Changed paths:
M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm
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] When an incremental PDF completes its load, blank pages are still visible
https://bugs.webkit.org/show_bug.cgi?id=273917
rdar://127713604
Reviewed by Tim Horton.
While loading an incremental PDF (potentially over a slow network connection), nothing
currently triggers repaints, so we never show pages as they load, nor do we repaint all
the pages when the load completes. This can leave you with blank pages until you scroll
or zoom.
Fix by hooking up some virtual functions on the plugin to give UnifiedPDFPlugin a way
to know when incremental loads progress, finish or cancel. While progressing, fire
a repeating timer every 1s to trigger repaints (we currently can't know which pages
become valid based on data ranges). Also trigger a repaint when the load completes.
This repaints use the coverage rect to only invalidate visible pages.
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
(WebKit::PDFPluginBase::incrementalLoadingDidProgress):
(WebKit::PDFPluginBase::incrementalLoadingDidCancel):
(WebKit::PDFPluginBase::incrementalLoadingDidFinish):
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::PDFPluginBase::streamDidReceiveData):
(WebKit::PDFPluginBase::streamDidFinishLoading):
(WebKit::PDFPluginBase::streamDidFail):
(WebKit::PDFPluginBase::receivedNonLinearizedPDFSentinel):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/AsyncPDFRenderer.mm:
(WebKit::AsyncPDFRenderer::coverageRectDidChange):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm:
(WebKit::PDFDocumentLayout::contentsSize const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::installPDFDocument):
(WebKit::UnifiedPDFPlugin::incrementalLoadingDidProgress):
(WebKit::UnifiedPDFPlugin::incrementalLoadingDidCancel):
(WebKit::UnifiedPDFPlugin::incrementalLoadingDidFinish):
(WebKit::UnifiedPDFPlugin::updatePageBackgroundLayers):
(WebKit::UnifiedPDFPlugin::incrementalLoadingRepaintTimerFired):
(WebKit::UnifiedPDFPlugin::repaintForIncrementalLoad):
(WebKit::UnifiedPDFPlugin::paintContents):
Canonical link: https://commits.webkit.org/278597@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list