WebKit Bugzilla
Attachment 339892 Details for
Bug 185449
: [iOS] WKPDFView remains in the view hierarchy after navigating away
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185449-20180508160333.patch (text/plain), 2.52 KB, created by
Andy Estes
on 2018-05-08 16:03:34 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2018-05-08 16:03:34 PDT
Size:
2.52 KB
patch
obsolete
>Subversion Revision: 231509 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 5b14e10b391baaee02a3e2bab2f76ca8d9a2bb10..2036f15561c83628766f0879f6b1b59a04a3f7b9 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,28 @@ >+2018-05-08 Andy Estes <aestes@apple.com> >+ >+ [iOS] WKPDFView remains in the view hierarchy after navigating away >+ https://bugs.webkit.org/show_bug.cgi?id=185449 >+ <rdar://problem/39693469> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ WKPDFView removes the PDF host view from the view hierarchy in its -dealloc >+ method, and relies on WKWebView releasing its last reference in >+ -_setHasCustomContentView:loadedMIMEType: when the user navigates. >+ >+ However, WKWPDFView was capturing a strong reference to self in the block passed >+ to +[PDFHostViewController createHostView:forExtensionIdentifier:], and PDFKit >+ (actually UIKit) is retaining this block beyond its being called. This results in >+ the PDF host view remaining as a child of the WKScrollView even after the user >+ navigates to another page. >+ >+ Changed the aforementioned block to a lambda that captures a weak reference to >+ self to prevent WKPDFView from outliving the current navigation. >+ >+ * UIProcess/ios/WKPDFView.mm: >+ (-[WKPDFView retain]): >+ (-[WKPDFView web_setContentProviderData:suggestedFilename:]): >+ > 2018-05-08 Dean Jackson <dino@apple.com> > > System Preview links should trigger a download >diff --git a/Source/WebKit/UIProcess/ios/WKPDFView.mm b/Source/WebKit/UIProcess/ios/WKPDFView.mm >index 5cbe8ceaf664f287c636e9ecb14bd4b28653e27a..7e7b34b858b77014536d1e9943cae5550f4bbbd7 100644 >--- a/Source/WebKit/UIProcess/ios/WKPDFView.mm >+++ b/Source/WebKit/UIProcess/ios/WKPDFView.mm >@@ -95,9 +95,14 @@ - (void)web_setContentProviderData:(NSData *)data suggestedFilename:(NSString *) > _data = adoptNS([data copy]); > _suggestedFilename = adoptNS([filename copy]); > >- [PDFHostViewController createHostView:^(PDFHostViewController * _Nullable hostViewController) { >+ WebKit::WeakObjCPtr<WKPDFView> weakSelf = self; >+ [PDFHostViewController createHostView:[self, weakSelf = WTFMove(weakSelf)](PDFHostViewController * _Nullable hostViewController) { > ASSERT(isMainThread()); > >+ WKPDFView *autoreleasedSelf = weakSelf.getAutoreleased(); >+ if (!autoreleasedSelf) >+ return; >+ > WKWebView *webView = _webView.getAutoreleased(); > if (!webView) > return;
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 185449
: 339892