WebKit Bugzilla
Attachment 356740 Details for
Bug 192469
: Web Share API: share overlay does not stick to the Safari window
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192469-20181206123212.patch (text/plain), 3.50 KB, created by
Tim Horton
on 2018-12-06 12:32:12 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2018-12-06 12:32:12 PST
Size:
3.50 KB
patch
obsolete
>Subversion Revision: 238908 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 58256a4bb7535c19c5e1085064a69720372738ab..545b16730f62c1853fc7679137f172fea2e87504 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,30 @@ >+2018-12-06 Tim Horton <timothy_horton@apple.com> >+ >+ Web Share API: share overlay does not stick to the Safari window >+ https://bugs.webkit.org/show_bug.cgi?id=192469 >+ <rdar://problem/46074833> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/Cocoa/WKShareSheet.mm: >+ (-[WKShareSheet sharingServicePicker:didChooseSharingService:]): >+ (-[WKShareSheet sharingServicePicker:delegateForSharingService:]): >+ (-[WKShareSheet sharingService:sourceWindowForShareItems:sharingContentScope:]): >+ (-[WKShareSheet sharingService:didFailToShareItems:error:]): >+ (-[WKShareSheet sharingService:didShareItems:]): >+ Implement another NSSharingServicePickerDelegate method to return >+ an *NSSharingService* delegate when needed. >+ >+ Implement an NSSharingServiceDelegate method to return the window that >+ the service's UI should attach to. >+ >+ Also, instead of notifying the Web Content process when a service is picked >+ (or not) in the NSSharingServicePicker, wait until the share has completed >+ (or failed) to send didComplete. This both makes the return completion >+ value more accurate (matching iOS, if you cancel the share during the >+ recipient choice step, it will now fail), and avoids explicitly tearing >+ down the NSSharingServicePicker too early, which breaks the UI attaching mechanism. >+ > 2018-12-05 Alex Christensen <achristensen@webkit.org> > > Make WebsiteDataStoreConfiguration a proper API object >diff --git a/Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm b/Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm >index ec54c7fde114797451e8451667feb3ffeec29386..e1b9ec37187a3d880329a0d7914dc17aae149118 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm >@@ -42,7 +42,7 @@ > #endif > > #if PLATFORM(MAC) >-@interface WKShareSheet () <NSSharingServicePickerDelegate> >+@interface WKShareSheet () <NSSharingServiceDelegate, NSSharingServicePickerDelegate> > @end > #endif > >@@ -124,9 +124,35 @@ - (void)presentWithParameters:(const WebCore::ShareDataWithParsedURL &)data comp > #if PLATFORM(MAC) > - (void)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker didChooseSharingService:(NSSharingService *)service > { >- [self _didCompleteWithSuccess:!!service]; >+ if (service) >+ return; >+ >+ [self _didCompleteWithSuccess:NO]; >+ [self dispatchDidDismiss]; >+} >+ >+- (id <NSSharingServiceDelegate>)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker delegateForSharingService:(NSSharingService *)sharingService >+{ >+ return self; >+} >+ >+- (NSWindow *)sharingService:(NSSharingService *)sharingService sourceWindowForShareItems:(NSArray *)items sharingContentScope:(NSSharingContentScope *)sharingContentScope >+{ >+ return [_webView window]; >+} >+ >+- (void)sharingService:(NSSharingService *)sharingService didFailToShareItems:(NSArray *)items error:(NSError *)error >+{ >+ [self _didCompleteWithSuccess:NO]; > [self dispatchDidDismiss]; > } >+ >+- (void)sharingService:(NSSharingService *)sharingService didShareItems:(NSArray *)items >+{ >+ [self _didCompleteWithSuccess:YES]; >+ [self dispatchDidDismiss]; >+} >+ > #endif > > - (void)_didCompleteWithSuccess:(BOOL)success
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 192469
: 356740