WebKit Bugzilla
Attachment 339009 Details for
Bug 185084
: [iOS] Try to unlock PDF documents before printing them
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185084-20180427114332.patch (text/plain), 2.71 KB, created by
Andy Estes
on 2018-04-27 11:43:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2018-04-27 11:43:33 PDT
Size:
2.71 KB
patch
obsolete
>Subversion Revision: 231104 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 49488361e50599bfe3f6c914fe5c8b427fe77029..feabf9aaecd3ea79e5e747599c01a8f4a27bcd62 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-04-27 Andy Estes <aestes@apple.com> >+ >+ [iOS] Try to unlock PDF documents before printing them >+ https://bugs.webkit.org/show_bug.cgi?id=185084 >+ <rdar://problem/39356622> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/ios/WKPDFView.mm: >+ (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]): >+ >+ Stored the password that successfully unlocked the current PDF document. >+ >+ (-[WKPDFView _wk_printedDocument]): >+ >+ Used the stored password to unlock the CGPDFDocument we create for printing. >+ > 2018-04-27 Daniel Bates <dabates@apple.com> > > UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS >diff --git a/Source/WebKit/UIProcess/ios/WKPDFView.mm b/Source/WebKit/UIProcess/ios/WKPDFView.mm >index 0d60750bf1af48a5b0cdf8923a377b84539c9022..435d413a8d37fcd6dbe519a63cfddc67290e9d66 100644 >--- a/Source/WebKit/UIProcess/ios/WKPDFView.mm >+++ b/Source/WebKit/UIProcess/ios/WKPDFView.mm >@@ -53,6 +53,7 @@ @implementation WKPDFView { > RetainPtr<PDFHostViewController> _hostViewController; > CGSize _overlaidAccessoryViewsInset; > RetainPtr<UIView> _pageNumberIndicator; >+ RetainPtr<NSString> _password; > RetainPtr<NSString> _suggestedFilename; > WebKit::WeakObjCPtr<WKWebView> _webView; > } >@@ -350,6 +351,11 @@ - (void)pdfHostViewController:(PDFHostViewController *)controller updatePageCoun > [self _scrollToURLFragment:[_webView URL].fragment]; > } > >+- (void)pdfHostViewController:(PDFHostViewController *)controller documentDidUnlockWithPassword:(NSString *)password >+{ >+ _password = adoptNS([password copy]); >+} >+ > - (void)pdfHostViewController:(PDFHostViewController *)controller findStringUpdate:(NSUInteger)numFound done:(BOOL)done > { > // FIXME: We should stop searching once numFound exceeds _findStringMaxCount, but PDFKit doesn't >@@ -407,7 +413,10 @@ - (NSUInteger)_wk_pageCountForPrintFormatter:(_WKWebViewPrintFormatter *)printFo > - (CGPDFDocumentRef)_wk_printedDocument > { > auto dataProvider = adoptCF(CGDataProviderCreateWithCFData((CFDataRef)_data.get())); >- return adoptCF(CGPDFDocumentCreateWithProvider(dataProvider.get())).autorelease(); >+ auto pdfDocument = adoptCF(CGPDFDocumentCreateWithProvider(dataProvider.get())); >+ if (!CGPDFDocumentIsUnlocked(pdfDocument.get())) >+ CGPDFDocumentUnlockWithPassword(pdfDocument.get(), [_password UTF8String]); >+ return pdfDocument.autorelease(); > } > > @end
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185084
:
339009
|
339110