WebKit Bugzilla
Attachment 372391 Details for
Bug 198974
: Update WebKit API to separately retrieve actions and use context menus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198974-20190618152706.patch (text/plain), 8.23 KB, created by
Alex Christensen
on 2019-06-18 15:27:06 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-06-18 15:27:06 PDT
Size:
8.23 KB
patch
obsolete
>Subversion Revision: 246563 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 3371ccfc311e6d83adb40c0804628c8b82ce54fd..764850c5b28c29da4dd76bf3a22bf5c87f4d0f8f 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2019-06-18 Alex Christensen <achristensen@webkit.org> >+ >+ Update WebKit API to separately retrieve actions and use context menus >+ https://bugs.webkit.org/show_bug.cgi?id=198974 >+ <rdar://problem/50735687> >+ >+ Reviewed by Tim Horton. >+ >+ Update API and SPI, and add infrastructure for asynchronously requesting interaction information. >+ >+ * UIProcess/API/Cocoa/WKUIDelegate.h: >+ * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: >+ > 2019-06-18 John Wilander <wilander@apple.com> > > Change log channel name from ResourceLoadStatisticsDebug to ITPDebug and remove unnecessary #if !RELEASE_LOG_DISABLED >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h >index a3544cea470f69cab469de62768b3dafe8c1bca1..19a5a914c2b5ac64e69ba403e6004be9a5ef5385 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h >@@ -39,6 +39,12 @@ NS_ASSUME_NONNULL_BEGIN > @class WKWebViewConfiguration; > @class WKWindowFeatures; > >+#if TARGET_OS_IPHONE >+@class WKContextMenuElementInfo; >+@class UIContextMenuConfiguration; >+@protocol UIContextMenuInteractionCommitAnimating; >+#endif >+ > /*! A class conforming to the WKUIDelegate protocol provides methods for > presenting native UI on behalf of a webpage. > */ >@@ -129,7 +135,7 @@ NS_ASSUME_NONNULL_BEGIN > This method will only be invoked for elements that have default preview in WebKit, which is > limited to links. In the future, it could be invoked for additional elements. > */ >-- (BOOL)webView:(WKWebView *)webView shouldPreviewElement:(WKPreviewElementInfo *)elementInfo WK_API_DEPRECATED("This API will be replaced", ios(10.0, WK_IOS_TBA)); >+- (BOOL)webView:(WKWebView *)webView shouldPreviewElement:(WKPreviewElementInfo *)elementInfo WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuConfigurationForElement:completionHandler:", ios(10.0, WK_IOS_TBA)); > > /*! @abstract Allows your app to provide a custom view controller to show when the given element is peeked. > @param webView The web view invoking the delegate method. >@@ -144,13 +150,53 @@ NS_ASSUME_NONNULL_BEGIN > Returning nil will result in WebKit's default preview behavior. webView:commitPreviewingViewController: will only be invoked > if a non-nil view controller was returned. > */ >-- (nullable UIViewController *)webView:(WKWebView *)webView previewingViewControllerForElement:(WKPreviewElementInfo *)elementInfo defaultActions:(NSArray<id <WKPreviewActionItem>> *)previewActions WK_API_DEPRECATED("This API will be replaced", ios(10.0, WK_IOS_TBA)); >+- (nullable UIViewController *)webView:(WKWebView *)webView previewingViewControllerForElement:(WKPreviewElementInfo *)elementInfo defaultActions:(NSArray<id <WKPreviewActionItem>> *)previewActions WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuConfigurationForElement:completionHandler:", ios(10.0, WK_IOS_TBA)); > > /*! @abstract Allows your app to pop to the view controller it created. > @param webView The web view invoking the delegate method. > @param previewingViewController The view controller that is being popped. > */ >-- (void)webView:(WKWebView *)webView commitPreviewingViewController:(UIViewController *)previewingViewController WK_API_DEPRECATED("This API will be replaced", ios(10.0, WK_IOS_TBA)); >+- (void)webView:(WKWebView *)webView commitPreviewingViewController:(UIViewController *)previewingViewController WK_API_DEPRECATED("webView:contextMenuForElement:willCommitWithAnimator:", ios(10.0, WK_IOS_TBA)); >+ >+/** >+ * @abstract Called when a context menu interaction begins. >+ * >+ * @param webView The web view invoking the delegate method. >+ * @param elementInfo The elementInfo for the element the user is touching. >+ * @param completionHandler A completion handler to call once a it has been decided whether or not to show a context menu. >+ * Pass a valid UIContextMenuConfiguration to show a context menu, or pass nil to not show a context menu. >+ */ >+ >+- (void)webView:(WKWebView *)webView contextMenuConfigurationForElement:(WKContextMenuElementInfo *)elementInfo completionHandler:(void (^)(UIContextMenuConfiguration * _Nullable configuration))completionHandler WK_API_AVAILABLE(ios(WK_IOS_TBA)); >+ >+/** >+ * @abstract Called when the context menu configured by the UIContextMenuConfiguration from >+ * webView:contextMenuConfigurationForElement:completionHandler: is committed. >+ * >+ * @param webView The web view invoking the delegate method. >+ * @param elementInfo The elementInfo for the element the user is touching. >+ * @param animator The animator to use for the commit animation. >+ */ >+ >+- (void)webView:(WKWebView *)webView contextMenuForElement:(WKContextMenuElementInfo *)elementInfo willCommitWithAnimator:(id<UIContextMenuInteractionCommitAnimating>)animator WK_API_AVAILABLE(ios(WK_IOS_TBA)); >+ >+/** >+ * @abstract Called when the context menu will be presented. >+ * >+ * @param webView The web view invoking the delegate method. >+ * @param elementInfo The elementInfo for the element the user is touching. >+ */ >+ >+- (void)webView:(WKWebView *)webView contextMenuWillPresentForElement:(WKContextMenuElementInfo *)elementInfo WK_API_AVAILABLE(ios(WK_IOS_TBA)); >+ >+/** >+ * @abstract Called when the context menu ends. >+ * >+ * @param webView The web view invoking the delegate method. >+ * @param elementInfo The elementInfo for the element the user is touching. >+ */ >+ >+- (void)webView:(WKWebView *)webView contextMenuDidEndForElement:(WKContextMenuElementInfo *)elementInfo WK_API_AVAILABLE(ios(WK_IOS_TBA)); > > #endif // TARGET_OS_IPHONE > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h >index d66dd6f2c2edf50a97fe07816973949b1277249d..a6c7083ee099fff27bc4edcd72a008b24b2cd3f0 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h >@@ -147,13 +147,13 @@ struct UIEdgeInsets; > - (void)_webView:(WKWebView *)webView didDismissPreviewViewController:(UIViewController *)previewedViewController WK_API_DEPRECATED_WITH_REPLACEMENT("webView:dismissContextMenu:", ios(9.0, WK_IOS_TBA)); > > #if TARGET_OS_IOS >-// This needs to be removed once there is an API version to continue to do callbacks for image element context menus. >+// This must be kept to continue to do callbacks for image element context menus. > - (void)_webView:(WKWebView *)webView contextMenuConfigurationForElement:(WKContextMenuElementInfo *)elementInfo completionHandler:(void(^)(UIContextMenuConfiguration *))completionHandler WK_API_AVAILABLE(ios(WK_IOS_TBA)); > >-// These can be removed once there is an API version. >-- (void)_webView:(WKWebView *)webView contextMenuForElement:(WKContextMenuElementInfo *)elementInfo willCommitWithAnimator:(id<UIContextMenuInteractionCommitAnimating>)animator WK_API_AVAILABLE(ios(WK_IOS_TBA)); >-- (void)_webView:(WKWebView *)webView contextMenuWillPresentForElement:(WKContextMenuElementInfo *)elementInfo WK_API_AVAILABLE(ios(WK_IOS_TBA)); >-- (void)_webView:(WKWebView *)webView contextMenuDidEndForElement:(WKContextMenuElementInfo *)elementInfo WK_API_AVAILABLE(ios(WK_IOS_TBA)); >+// These can be removed once the API version is adopted by all clients. >+- (void)_webView:(WKWebView *)webView contextMenuForElement:(WKContextMenuElementInfo *)elementInfo willCommitWithAnimator:(id<UIContextMenuInteractionCommitAnimating>)animator WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuForElement:willCommitWithAnimator:", ios(WK_IOS_TBA, WK_IOS_TBA)); >+- (void)_webView:(WKWebView *)webView contextMenuWillPresentForElement:(WKContextMenuElementInfo *)elementInfo WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuWillPresentForElement:", ios(WK_IOS_TBA, WK_IOS_TBA)); >+- (void)_webView:(WKWebView *)webView contextMenuDidEndForElement:(WKContextMenuElementInfo *)elementInfo WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuDidEndForElement:", ios(WK_IOS_TBA, WK_IOS_TBA)); > #endif > > - (BOOL)_webView:(WKWebView *)webView showCustomSheetForElement:(_WKActivatedElementInfo *)element WK_API_AVAILABLE(ios(10.0));
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
Flags:
commit-queue
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198974
:
372371
| 372391