NEW286549
[UnifiedPDF] Incremental PDF Loading should be used on iOS family
https://bugs.webkit.org/show_bug.cgi?id=286549
Summary [UnifiedPDF] Incremental PDF Loading should be used on iOS family
Abrar Rahman Protyasha
Reported 2025-01-26 01:53:09 PST
Currently, with UnifiedPDF enabled, we do not use incremental PDF loading on iOS family. This is because said loading path is gated behind HAVE(INCREMENTAL_PDF_APIS) platform availability. However, all of the following SPI (which the platform availability macro guards against) are available on the iOS family platforms. ``` // CoreGraphics extern const off_t kCGDataProviderIndeterminateSize; extern const CFStringRef kCGDataProviderHasHighLatency; typedef void (*CGDataProviderGetByteRangesCallback)(void *info, CFMutableArrayRef buffers, const CFRange *ranges, size_t count); struct CGDataProviderDirectAccessRangesCallbacks { unsigned version; CGDataProviderGetBytesAtPositionCallback getBytesAtPosition; CGDataProviderGetByteRangesCallback getBytesInRanges; CGDataProviderReleaseInfoCallback releaseInfo; }; typedef struct CGDataProviderDirectAccessRangesCallbacks CGDataProviderDirectAccessRangesCallbacks; extern void CGDataProviderSetProperty(CGDataProviderRef, CFStringRef key, CFTypeRef value); extern CGDataProviderRef CGDataProviderCreateMultiRangeDirectAccess( void *info, off_t size, const CGDataProviderDirectAccessRangesCallbacks *); ``` ``` // PDFKit @interface PDFDocument () -(instancetype)initWithProvider:(CGDataProviderRef)dataProvider; -(void)preloadDataOfPagesInRange:(NSRange)range onQueue:(dispatch_queue_t)queue completion:(void (^)(NSIndexSet* loadedPageIndexes))completionBlock; -(void)resetFormFields:(PDFActionResetForm *) action; @property (readwrite, nonatomic) BOOL hasHighLatencyDataProvider; @end ``` As such, we should try flipping incremental PDF loading for that platform family.
Attachments
Radar WebKit Bug Importer
Comment 1 2025-01-26 01:53:18 PST
Abrar Rahman Protyasha
Comment 2 2025-12-04 19:26:57 PST
Note You need to log in before you can comment on or make changes to this bug.