-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
7 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters