WebKit Bugzilla
Attachment 342211 Details for
Bug 186413
: [iOS] Unable to present the share sheet after saving a PDF to Files.app
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186413-20180607152824.patch (text/plain), 5.34 KB, created by
Andy Estes
on 2018-06-07 15:28:25 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2018-06-07 15:28:25 PDT
Size:
5.34 KB
patch
obsolete
>Subversion Revision: 232585 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index bc353f0ae548f4e095ecd4bcce79fcb65b3fca1f..c0226e71a605446a808cd33bf6f17d9bcc6d86df 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,33 @@ >+2018-06-07 Andy Estes <aestes@apple.com> >+ >+ [iOS] Unable to present the share sheet after saving a PDF to Files.app >+ https://bugs.webkit.org/show_bug.cgi?id=186413 >+ <rdar://problem/39937488> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ WKApplicationStateTrackingView (WKPDFView's superclass) keeps track of whether >+ it's in a window so that it can suspend and resume the web process accordingly. >+ However, in WKPDFView's case, PDFKit's host view is in the window instead of >+ WKPDFView itself when a PDF is being displayed (WKPDFView is only in a window as a >+ placeholder while the PDF loads). Since WKApplicationStateTrackingView doesn't >+ think its in a window, it suspends the web process, preventing messages necessary >+ to displaying the share sheet from being delivered. >+ >+ Fix this by teaching WKApplicationStateTrackingView to consider the in-windowness >+ of the proper content view. For all cases other than WKPDFView, this is |self|. >+ For WKPDFView, it is the PDFHostViewController's root view if it exists, otherwise >+ it's |self|. >+ >+ * UIProcess/ios/WKApplicationStateTrackingView.h: >+ * UIProcess/ios/WKApplicationStateTrackingView.mm: >+ (-[WKApplicationStateTrackingView willMoveToWindow:]): >+ (-[WKApplicationStateTrackingView didMoveToWindow]): >+ (-[WKApplicationStateTrackingView _contentView]): >+ * UIProcess/ios/WKPDFView.mm: >+ (-[WKPDFView _contentView]): >+ (-[WKPDFView web_contentView]): >+ > 2018-06-07 Brent Fulgham <bfulgham@apple.com> > > Remove unused debug mode conditions >diff --git a/Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.h b/Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.h >index 864118b4e1a7860cae909b6e308cd0d4b24530d0..fd7e78ad7242805cb3e0e49d3803ba781181a6c4 100644 >--- a/Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.h >+++ b/Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.h >@@ -35,6 +35,7 @@ > - (void)_applicationDidCreateWindowContext; > - (void)_applicationWillEnterForeground; > @property (nonatomic, readonly) BOOL isBackground; >+@property (nonatomic, readonly) UIView *_contentView; > > @end > >diff --git a/Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.mm b/Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.mm >index 793a2cd132f18859675900f4161f7ef117969f03..037fdd30fe1c541c211c84d5358147e51581bdf7 100644 >--- a/Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.mm >+++ b/Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.mm >@@ -50,7 +50,7 @@ - (instancetype)initWithFrame:(CGRect)frame webView:(WKWebView *)webView > > - (void)willMoveToWindow:(UIWindow *)newWindow > { >- if (!self.window || newWindow) >+ if (!self._contentView.window || newWindow) > return; > > ASSERT(_applicationStateTracker); >@@ -59,7 +59,7 @@ - (void)willMoveToWindow:(UIWindow *)newWindow > > - (void)didMoveToWindow > { >- if (!self.window) >+ if (!self._contentView.window) > return; > > ASSERT(!_applicationStateTracker); >@@ -101,6 +101,11 @@ - (BOOL)isBackground > return _applicationStateTracker ? _applicationStateTracker->isInBackground() : YES; > } > >+- (UIView *)_contentView >+{ >+ return self; >+} >+ > @end > > #endif // PLATFORM(IOS) >diff --git a/Source/WebKit/UIProcess/ios/WKPDFView.mm b/Source/WebKit/UIProcess/ios/WKPDFView.mm >index a90613e4aa6694037765b6f1a8716940349fd28e..452d7ac50d4034ba8d1baa38b235d95a6a50b8a1 100644 >--- a/Source/WebKit/UIProcess/ios/WKPDFView.mm >+++ b/Source/WebKit/UIProcess/ios/WKPDFView.mm >@@ -77,6 +77,15 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer > return [_hostViewController gestureRecognizerShouldBegin:gestureRecognizer]; > } > >+ >+#pragma mark WKApplicationStateTrackingView >+ >+- (UIView *)_contentView >+{ >+ return _hostViewController ? [_hostViewController view] : self; >+} >+ >+ > #pragma mark WKWebViewContentProvider > > - (instancetype)web_initWithFrame:(CGRect)frame webView:(WKWebView *)webView mimeType:(NSString *)mimeType >@@ -321,7 +330,7 @@ - (void)web_hideFindUI > > - (UIView *)web_contentView > { >- return _hostViewController ? [_hostViewController view] : self; >+ return self._contentView; > } > > - (void)web_scrollViewDidScroll:(UIScrollView *)scrollView >@@ -369,6 +378,7 @@ - (BOOL)web_isBackground > return self.isBackground; > } > >+ > #pragma mark PDFHostViewControllerDelegate > > - (void)pdfHostViewController:(PDFHostViewController *)controller updatePageCount:(NSInteger)pageCount >@@ -445,6 +455,7 @@ - (void)pdfHostViewController:(PDFHostViewController *)controller didLongPressPa > [self _showActionSheetForURL:[self _URLWithPageIndex:pageIndex] atLocation:location withAnnotationRect:annotationRect]; > } > >+ > #pragma mark WKActionSheetAssistantDelegate > > - (std::optional<WebKit::InteractionInformationAtPosition>)positionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant >@@ -498,6 +509,7 @@ - (RetainPtr<NSArray>)actionSheetAssistant:(WKActionSheetAssistant *)assistant d > > @end > >+ > #pragma mark _WKWebViewPrintProvider > > #if !ENABLE(MINIMAL_SIMULATOR)
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 186413
: 342211