⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 246252 in webkit


Ignore:
Timestamp:
Jun 9, 2019, 11:25:36 PM (7 years ago)
Author:
bshafiei@apple.com
Message:

Cherry-pick r246224. rdar://problem/51462498

Introduce new SPI for context menus on iOS
https://bugs.webkit.org/show_bug.cgi?id=198590

Reviewed by Tim Horton.

Also introduce WKContextMenuElementInfo which is API.
This is part of <rdar://problem/51003503>

  • Shared/API/APIObject.h:
  • Shared/API/Cocoa/WebKit.h:
  • Shared/Cocoa/APIObject.mm: (API::Object::newObject):
  • Sources.txt:
  • SourcesCocoa.txt:
  • UIProcess/API/APIContextMenuElementInfo.cpp: Added. (API::ContextMenuElementInfo::ContextMenuElementInfo):
  • UIProcess/API/APIContextMenuElementInfo.h: Added.
  • UIProcess/API/Cocoa/WKContextMenuElementInfo.h: Added.
  • UIProcess/API/Cocoa/WKContextMenuElementInfo.mm: Added. (-[WKContextMenuElementInfo linkURL]): (-[WKContextMenuElementInfo _apiObject]): (-[WKContextMenuElementInfo _activatedElementInfo]):
  • UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h: Added.
  • UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h: Added.
  • UIProcess/API/Cocoa/WKPreviewElementInfo.h:
  • UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
  • UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
  • UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]): (-[_WKActivatedElementInfo isAnimatedImage]):
  • UIProcess/ios/WKActionSheetAssistant.h:
  • UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant defaultActionsForLinkSheet:]): (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
  • UIProcess/ios/WKContentView.h:
  • UIProcess/ios/WKContentViewInteraction.mm:
  • WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246224 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-608.1.27-branch/Source/WebKit
Files:
17 edited
6 copied

Legend:

Unmodified
Added
Removed
  • branches/safari-608.1.27-branch/Source/WebKit/ChangeLog

    r246251 r246252  
     12019-06-09  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r246224. rdar://problem/51462498
     4
     5    Introduce new SPI for context menus on iOS
     6    https://bugs.webkit.org/show_bug.cgi?id=198590
     7   
     8    Reviewed by Tim Horton.
     9   
     10    Also introduce WKContextMenuElementInfo which is API.
     11    This is part of <rdar://problem/51003503>
     12   
     13    * Shared/API/APIObject.h:
     14    * Shared/API/Cocoa/WebKit.h:
     15    * Shared/Cocoa/APIObject.mm:
     16    (API::Object::newObject):
     17    * Sources.txt:
     18    * SourcesCocoa.txt:
     19    * UIProcess/API/APIContextMenuElementInfo.cpp: Added.
     20    (API::ContextMenuElementInfo::ContextMenuElementInfo):
     21    * UIProcess/API/APIContextMenuElementInfo.h: Added.
     22    * UIProcess/API/Cocoa/WKContextMenuElementInfo.h: Added.
     23    * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm: Added.
     24    (-[WKContextMenuElementInfo linkURL]):
     25    (-[WKContextMenuElementInfo _apiObject]):
     26    (-[WKContextMenuElementInfo _activatedElementInfo]):
     27    * UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h: Added.
     28    * UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h: Added.
     29    * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
     30    * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
     31    * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
     32    * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
     33    (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
     34    (-[_WKActivatedElementInfo isAnimatedImage]):
     35    * UIProcess/ios/WKActionSheetAssistant.h:
     36    * UIProcess/ios/WKActionSheetAssistant.mm:
     37    (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
     38    (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
     39    * UIProcess/ios/WKContentView.h:
     40    * UIProcess/ios/WKContentViewInteraction.mm:
     41    * WebKit.xcodeproj/project.pbxproj:
     42   
     43    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     44
     45    2019-06-05  Alex Christensen  <achristensen@webkit.org>
     46
     47            Introduce new SPI for context menus on iOS
     48            https://bugs.webkit.org/show_bug.cgi?id=198590
     49
     50            Reviewed by Tim Horton.
     51
     52            Also introduce WKContextMenuElementInfo which is API.
     53            This is part of <rdar://problem/51003503>
     54
     55            * Shared/API/APIObject.h:
     56            * Shared/API/Cocoa/WebKit.h:
     57            * Shared/Cocoa/APIObject.mm:
     58            (API::Object::newObject):
     59            * Sources.txt:
     60            * SourcesCocoa.txt:
     61            * UIProcess/API/APIContextMenuElementInfo.cpp: Added.
     62            (API::ContextMenuElementInfo::ContextMenuElementInfo):
     63            * UIProcess/API/APIContextMenuElementInfo.h: Added.
     64            * UIProcess/API/Cocoa/WKContextMenuElementInfo.h: Added.
     65            * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm: Added.
     66            (-[WKContextMenuElementInfo linkURL]):
     67            (-[WKContextMenuElementInfo _apiObject]):
     68            (-[WKContextMenuElementInfo _activatedElementInfo]):
     69            * UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h: Added.
     70            * UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h: Added.
     71            * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
     72            * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
     73            * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
     74            * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
     75            (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
     76            (-[_WKActivatedElementInfo isAnimatedImage]):
     77            * UIProcess/ios/WKActionSheetAssistant.h:
     78            * UIProcess/ios/WKActionSheetAssistant.mm:
     79            (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
     80            (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
     81            * UIProcess/ios/WKContentView.h:
     82            * UIProcess/ios/WKContentViewInteraction.mm:
     83            * WebKit.xcodeproj/project.pbxproj:
     84
    1852019-06-09  Babak Shafiei  <bshafiei@apple.com>
    286
  • branches/safari-608.1.27-branch/Source/WebKit/Shared/API/APIObject.h

    r245481 r246252  
    110110        ContentRuleListAction,
    111111        ContentRuleListStore,
     112#if PLATFORM(IOS_FAMILY)
     113        ContextMenuElementInfo,
     114#endif
    112115        ContextMenuListener,
    113116        CookieManager,
  • branches/safari-608.1.27-branch/Source/WebKit/Shared/API/Cocoa/WebKit.h

    r243787 r246252  
    2828#import <WebKit/WKContentRuleList.h>
    2929#import <WebKit/WKContentRuleListStore.h>
     30#import <WebKit/WKContextMenuElementInfo.h>
    3031#import <WebKit/WKError.h>
    3132#import <WebKit/WKFoundation.h>
  • branches/safari-608.1.27-branch/Source/WebKit/Shared/Cocoa/APIObject.mm

    r245481 r246252  
    3434#import "WKContentRuleListInternal.h"
    3535#import "WKContentRuleListStoreInternal.h"
     36#import "WKContextMenuElementInfoInternal.h"
    3637#import "WKFrameInfoInternal.h"
    3738#import "WKHTTPCookieStoreInternal.h"
     
    314315        break;
    315316
     317#if PLATFORM(IOS_FAMILY)
     318    case Type::ContextMenuElementInfo:
     319        wrapper = [WKContextMenuElementInfo alloc];
     320        break;
     321#endif
     322
    316323    case Type::CustomHeaderFields:
    317324        wrapper = [_WKCustomHeaderFields alloc];
  • branches/safari-608.1.27-branch/Source/WebKit/Sources.txt

    r245540 r246252  
    301301UIProcess/API/APIContentRuleListAction.cpp
    302302UIProcess/API/APIContentRuleListStore.cpp
     303UIProcess/API/APIContextMenuElementInfo.cpp
    303304UIProcess/API/APIExperimentalFeature.cpp
    304305UIProcess/API/APIFrameInfo.cpp
  • branches/safari-608.1.27-branch/Source/WebKit/SourcesCocoa.txt

    r245540 r246252  
    283283UIProcess/API/Cocoa/WKContentRuleList.mm
    284284UIProcess/API/Cocoa/WKContentRuleListStore.mm
     285UIProcess/API/Cocoa/WKContextMenuElementInfo.mm
    285286UIProcess/API/Cocoa/WKError.mm
    286287UIProcess/API/Cocoa/WKFrameInfo.mm
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/APIContextMenuElementInfo.cpp

    r246251 r246252  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #import <WebKit/WKFoundation.h>
     26#include "config.h"
     27#include "APIContextMenuElementInfo.h"
    2728
    28 #if TARGET_OS_IPHONE
     29#if PLATFORM(IOS_FAMILY)
    2930
    30 #import <Foundation/Foundation.h>
     31namespace API {
    3132
    32 NS_ASSUME_NONNULL_BEGIN
     33ContextMenuElementInfo::ContextMenuElementInfo(const WebKit::InteractionInformationAtPosition& info)
     34    : m_interactionInformation(info)
     35{
     36}
    3337
    34 WK_CLASS_AVAILABLE(ios(10.0))
    35 @interface WKPreviewElementInfo : NSObject <NSCopying>
     38} // namespace API
    3639
    37 @property (nonatomic, readonly, nullable) NSURL *linkURL;
    38 
    39 @end
    40 
    41 NS_ASSUME_NONNULL_END
    42 
    43 #endif
     40#endif // PLATFORM(IOS_FAMILY)
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/APIContextMenuElementInfo.h

    r246251 r246252  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #import <WebKit/WKFoundation.h>
     26#pragma once
    2727
    28 #if TARGET_OS_IPHONE
     28#if PLATFORM(IOS_FAMILY)
    2929
    30 #import <Foundation/Foundation.h>
     30#include "APIObject.h"
     31#include "InteractionInformationAtPosition.h"
    3132
    32 NS_ASSUME_NONNULL_BEGIN
     33namespace API {
    3334
    34 WK_CLASS_AVAILABLE(ios(10.0))
    35 @interface WKPreviewElementInfo : NSObject <NSCopying>
     35class ContextMenuElementInfo final : public ObjectImpl<Object::Type::ContextMenuElementInfo> {
     36public:
     37    template<typename... Args> static Ref<ContextMenuElementInfo> create(Args&&... args)
     38    {
     39        return adoptRef(*new ContextMenuElementInfo(std::forward<Args>(args)...));
     40    }
     41   
     42    const WTF::URL& url() const { return m_interactionInformation.url; }
    3643
    37 @property (nonatomic, readonly, nullable) NSURL *linkURL;
     44    const WebKit::InteractionInformationAtPosition& interactionInformation() const { return m_interactionInformation; }
    3845
    39 @end
     46private:
     47    ContextMenuElementInfo(const WebKit::InteractionInformationAtPosition&);
     48   
     49    WebKit::InteractionInformationAtPosition m_interactionInformation;
     50};
    4051
    41 NS_ASSUME_NONNULL_END
     52} // namespace API
    4253
    4354#endif
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfo.h

    r246251 r246252  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3232NS_ASSUME_NONNULL_BEGIN
    3333
    34 WK_CLASS_AVAILABLE(ios(10.0))
    35 @interface WKPreviewElementInfo : NSObject <NSCopying>
     34WK_CLASS_AVAILABLE(ios(WK_IOS_TBA))
     35@interface WKContextMenuElementInfo : NSObject
     36
     37- (instancetype)init NS_UNAVAILABLE;
    3638
    3739@property (nonatomic, readonly, nullable) NSURL *linkURL;
     
    4244
    4345#endif
     46
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfo.mm

    r246251 r246252  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #import <WebKit/WKFoundation.h>
     26#import "config.h"
     27#import "WKContextMenuElementInfoInternal.h"
    2728
    28 #if TARGET_OS_IPHONE
     29#if PLATFORM(IOS_FAMILY)
    2930
    30 #import <Foundation/Foundation.h>
     31#import "_WKActivatedElementInfoInternal.h"
    3132
    32 NS_ASSUME_NONNULL_BEGIN
     33@implementation WKContextMenuElementInfo
    3334
    34 WK_CLASS_AVAILABLE(ios(10.0))
    35 @interface WKPreviewElementInfo : NSObject <NSCopying>
     35- (NSURL *)linkURL
     36{
     37    return _elementInfo->url();
     38}
    3639
    37 @property (nonatomic, readonly, nullable) NSURL *linkURL;
     40- (API::Object&)_apiObject
     41{
     42    return *_elementInfo;
     43}
    3844
    3945@end
    4046
    41 NS_ASSUME_NONNULL_END
     47@implementation WKContextMenuElementInfo (WKPrivate)
     48
     49- (_WKActivatedElementInfo *)_activatedElementInfo
     50{
     51    return [_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:_elementInfo->interactionInformation()];
     52}
     53
     54@end
    4255
    4356#endif
     57
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h

    r246251 r246252  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #import <WebKit/WKFoundation.h>
     26#import "APIContextMenuElementInfo.h"
     27#import "WKContextMenuElementInfo.h"
     28#import "WKObject.h"
    2729
    28 #if TARGET_OS_IPHONE
     30#if PLATFORM(IOS_FAMILY)
    2931
    30 #import <Foundation/Foundation.h>
     32namespace WebKit {
    3133
    32 NS_ASSUME_NONNULL_BEGIN
     34template<> struct WrapperTraits<API::ContextMenuElementInfo> {
     35    using WrapperClass = WKContextMenuElementInfo;
     36};
    3337
    34 WK_CLASS_AVAILABLE(ios(10.0))
    35 @interface WKPreviewElementInfo : NSObject <NSCopying>
     38}
    3639
    37 @property (nonatomic, readonly, nullable) NSURL *linkURL;
    38 
     40@interface WKContextMenuElementInfo () <WKObject> {
     41@package
     42    API::ObjectStorage<API::ContextMenuElementInfo> _elementInfo;
     43}
    3944@end
    4045
    41 NS_ASSUME_NONNULL_END
    42 
    43 #endif
     46#endif // PLATFORM(IOS_FAMILY)
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h

    r246251 r246252  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #import <WebKit/WKFoundation.h>
     26#import <WebKit/WKContextMenuElementInfo.h>
    2727
    28 #if TARGET_OS_IPHONE
     28@class _WKActivatedElementInfo;
    2929
    30 #import <Foundation/Foundation.h>
     30@interface WKContextMenuElementInfo (WKPrivate)
    3131
    32 NS_ASSUME_NONNULL_BEGIN
    33 
    34 WK_CLASS_AVAILABLE(ios(10.0))
    35 @interface WKPreviewElementInfo : NSObject <NSCopying>
    36 
    37 @property (nonatomic, readonly, nullable) NSURL *linkURL;
     32@property (nonatomic, copy, readonly) _WKActivatedElementInfo *_activatedElementInfo;
    3833
    3934@end
    40 
    41 NS_ASSUME_NONNULL_END
    42 
    43 #endif
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreviewElementInfo.h

    r242339 r246252  
    3232NS_ASSUME_NONNULL_BEGIN
    3333
    34 WK_CLASS_AVAILABLE(ios(10.0))
     34WK_CLASS_DEPRECATED_WITH_REPLACEMENT("WKContextMenuElementInfo", ios(10.0, WK_IOS_TBA))
    3535@interface WKPreviewElementInfo : NSObject <NSCopying>
    3636
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h

    r245294 r246252  
    4141
    4242#if TARGET_OS_IOS
     43@class UIContextMenuConfiguration;
    4344@class UIDragItem;
    4445@class UITargetedDragPreview;
     46@class WKContextMenuElementInfo;
     47@protocol UIContextMenuInteractionCommitAnimating;
    4548@protocol UIDragSession;
    4649@protocol UIDropSession;
     
    136139- (BOOL)_webView:(WKWebView *)webView shouldRequestGeolocationAuthorizationForURL:(NSURL *)url isMainFrame:(BOOL)isMainFrame mainFrameURL:(NSURL *)mainFrameURL;
    137140- (void)_webView:(WKWebView *)webView requestGeolocationAuthorizationForURL:(NSURL *)url frame:(WKFrameInfo *)frame decisionHandler:(void (^)(BOOL authorized))decisionHandler WK_API_AVAILABLE(ios(11.0));
    138 - (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForURL:(NSURL *)url WK_API_AVAILABLE(ios(9.0));
    139 - (void)_webView:(WKWebView *)webView commitPreviewedViewController:(UIViewController *)previewedViewController WK_API_AVAILABLE(ios(9.0));
    140 - (void)_webView:(WKWebView *)webView willPreviewImageWithURL:(NSURL *)imageURL WK_API_AVAILABLE(ios(9.0));
    141 - (void)_webView:(WKWebView *)webView commitPreviewedImageWithURL:(NSURL *)imageURL WK_API_AVAILABLE(ios(9.0));
    142 - (void)_webView:(WKWebView *)webView didDismissPreviewViewController:(UIViewController *)previewedViewController committing:(BOOL)committing WK_API_AVAILABLE(ios(9.0));
    143 - (void)_webView:(WKWebView *)webView didDismissPreviewViewController:(UIViewController *)previewedViewController WK_API_AVAILABLE(ios(9.0));
     141
     142- (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForURL:(NSURL *)url WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuConfigurationForElement:completionHandler:", ios(9.0, WK_IOS_TBA));
     143- (void)_webView:(WKWebView *)webView commitPreviewedViewController:(UIViewController *)previewedViewController WK_API_DEPRECATED_WITH_REPLACEMENT("webView:commitContextMenu:", ios(9.0, WK_IOS_TBA));
     144- (void)_webView:(WKWebView *)webView willPreviewImageWithURL:(NSURL *)imageURL WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuConfigurationForElement:completionHandler:", ios(9.0, WK_IOS_TBA));
     145- (void)_webView:(WKWebView *)webView commitPreviewedImageWithURL:(NSURL *)imageURL WK_API_DEPRECATED_WITH_REPLACEMENT("webView:commitContextMenu:", ios(9.0, WK_IOS_TBA));
     146- (void)_webView:(WKWebView *)webView didDismissPreviewViewController:(UIViewController *)previewedViewController committing:(BOOL)committing WK_API_DEPRECATED_WITH_REPLACEMENT("webView:dismissContextMenu:", ios(9.0, WK_IOS_TBA));
     147- (void)_webView:(WKWebView *)webView didDismissPreviewViewController:(UIViewController *)previewedViewController WK_API_DEPRECATED_WITH_REPLACEMENT("webView:dismissContextMenu:", ios(9.0, WK_IOS_TBA));
     148
     149#if TARGET_OS_IOS
     150// This needs to be removed once there is an API version to continue to do callbacks for image element context menus.
     151- (void)_webView:(WKWebView *)webView contextMenuConfigurationForElement:(WKContextMenuElementInfo *)elementInfo completionHandler:(void(^)(UIContextMenuConfiguration *))completionHandler WK_API_AVAILABLE(ios(WK_IOS_TBA));
     152
     153// These can be removed once there is an API version.
     154- (void)_webView:(WKWebView *)webView contextMenuForElement:(WKContextMenuElementInfo *)elementInfo willCommitWithAnimator:(id<UIContextMenuInteractionCommitAnimating>)animator WK_API_AVAILABLE(ios(WK_IOS_TBA));
     155- (void)_webView:(WKWebView *)webView contextMenuWillPresentForElement:(WKContextMenuElementInfo *)elementInfo WK_API_AVAILABLE(ios(WK_IOS_TBA));
     156- (void)_webView:(WKWebView *)webView contextMenuDidEndForElement:(WKContextMenuElementInfo *)elementInfo WK_API_AVAILABLE(ios(WK_IOS_TBA));
     157#endif
     158
    144159- (BOOL)_webView:(WKWebView *)webView showCustomSheetForElement:(_WKActivatedElementInfo *)element WK_API_AVAILABLE(ios(10.0));
    145160- (void)_webView:(WKWebView *)webView alternateActionForURL:(NSURL *)url WK_API_AVAILABLE(ios(10.0));
     
    148163- (NSUInteger)_webView:(WKWebView *)webView indexIntoAttachmentListForElement:(_WKActivatedElementInfo *)element WK_API_AVAILABLE(ios(10.3));
    149164- (UIEdgeInsets)_webView:(WKWebView *)webView finalObscuredInsetsForScrollView:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset WK_API_AVAILABLE(ios(9.0));
    150 - (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForURL:(NSURL *)url defaultActions:(NSArray<_WKElementAction *> *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo WK_API_AVAILABLE(ios(9.0));
    151 - (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForAnimatedImageAtURL:(NSURL *)url defaultActions:(NSArray<_WKElementAction *> *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo imageSize:(CGSize)imageSize WK_API_AVAILABLE(ios(9.0));
     165- (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForURL:(NSURL *)url defaultActions:(NSArray<_WKElementAction *> *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuConfigurationForElement:", ios(9.0, WK_IOS_TBA));
     166- (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForAnimatedImageAtURL:(NSURL *)url defaultActions:(NSArray<_WKElementAction *> *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo imageSize:(CGSize)imageSize WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuConfigurationForElement:", ios(9.0, WK_IOS_TBA));
    152167- (UIViewController *)_presentingViewControllerForWebView:(WKWebView *)webView WK_API_AVAILABLE(ios(10.0));
    153168- (void)_webView:(WKWebView *)webView getAlternateURLFromImage:(UIImage *)image completionHandler:(void (^)(NSURL *alternateURL, NSDictionary *userInfo))completionHandler WK_API_AVAILABLE(ios(11.0));
    154169- (NSURL *)_webView:(WKWebView *)webView alternateURLFromImage:(UIImage *)image userInfo:(NSDictionary **)userInfo WK_API_AVAILABLE(ios(11.0));
    155 - (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForImage:(UIImage *)image alternateURL:(NSURL *)url defaultActions:(NSArray<_WKElementAction *> *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo WK_API_AVAILABLE(ios(11.0));
     170- (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForImage:(UIImage *)image alternateURL:(NSURL *)url defaultActions:(NSArray<_WKElementAction *> *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuConfigurationForElement:", ios(11.0, WK_IOS_TBA));
    156171- (NSArray *)_webView:(WKWebView *)webView adjustedDataInteractionItemProviders:(NSArray *)originalItemProviders WK_API_AVAILABLE(ios(11.0));
    157172- (NSArray *)_webView:(WKWebView *)webView adjustedDataInteractionItemProvidersForItemProvider:(id)itemProvider representingObjects:(NSArray *)representingObjects additionalData:(NSDictionary *)additionalData WK_API_AVAILABLE(ios(11.0));
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/_WKActivatedElementInfo.h

    r244368 r246252  
    4848@property (nonatomic, readonly) CGRect boundingRect;
    4949@property (nonatomic, readonly) NSString *ID WK_API_AVAILABLE(macos(10.12), ios(10.0));
     50@property (nonatomic, readonly) BOOL isAnimatedImage WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    5051#if TARGET_OS_IPHONE
    5152@property (nonatomic, readonly) NSDictionary *userInfo WK_API_AVAILABLE(ios(11.0));
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/_WKActivatedElementInfo.mm

    r244368 r246252  
    5252    RetainPtr<NSImage> _nsImage;
    5353#endif
     54    BOOL _animatedImage;
    5455}
    5556
     
    8283    _image = information.image;
    8384    _ID = information.idAttribute;
     85    _animatedImage = information.isAnimatedImage;
    8486   
    8587    return self;
     
    137139}
    138140
     141- (BOOL)isAnimatedImage
     142{
     143    return _animatedImage;
     144}
     145
    139146#if PLATFORM(IOS_FAMILY)
    140147- (NSDictionary *)userInfo
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h

    r245072 r246252  
    141141class WebPageProxy;
    142142class WebProcessPool;
     143class WebProcessProxy;
    143144struct ColorSpaceData;
    144145struct WebHitTestResultData;
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm

    r245796 r246252  
    15701570    NSView *webView = m_view.getAutoreleased();
    15711571
    1572     if (direction == FocusDirectionForward) {
     1572    if (direction == WebCore::FocusDirectionForward) {
    15731573        // Since we're trying to move focus out of m_webView, and because
    15741574        // m_webView may contain subviews within it, we ask it for the next key
     
    36123612        if ([parameter isKindOfClass:[NSValue class]]) {
    36133613            NSRect rect = [(NSValue *)parameter rectValue];
    3614             return [NSValue valueWithRect:m_pageClient->rootViewToScreen(IntRect(rect))];
     3614            return [NSValue valueWithRect:m_pageClient->rootViewToScreen(WebCore::IntRect(rect))];
    36153615        }
    36163616    }
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h

    r242801 r246252  
    3939@class WKActionSheetAssistant;
    4040@class _WKActivatedElementInfo;
     41@class _WKElementAction;
    4142@protocol WKActionSheetDelegate;
    4243
     
    7778- (void)cleanupSheet;
    7879- (void)updateSheetPosition;
    79 - (RetainPtr<NSArray>)defaultActionsForLinkSheet:(_WKActivatedElementInfo *)elementInfo;
    80 - (RetainPtr<NSArray>)defaultActionsForImageSheet:(_WKActivatedElementInfo *)elementInfo;
     80- (RetainPtr<NSArray<_WKElementAction *>>)defaultActionsForLinkSheet:(_WKActivatedElementInfo *)elementInfo;
     81- (RetainPtr<NSArray<_WKElementAction *>>)defaultActionsForImageSheet:(_WKActivatedElementInfo *)elementInfo;
    8182- (BOOL)isShowingSheet;
    8283- (void)interactionDidStartWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)information;
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm

    r244955 r246252  
    530530}
    531531
    532 - (RetainPtr<NSArray>)defaultActionsForLinkSheet:(_WKActivatedElementInfo *)elementInfo
     532- (RetainPtr<NSArray<_WKElementAction *>>)defaultActionsForLinkSheet:(_WKActivatedElementInfo *)elementInfo
    533533{
    534534    NSURL *targetURL = [elementInfo URL];
     
    551551}
    552552
    553 - (RetainPtr<NSArray>)defaultActionsForImageSheet:(_WKActivatedElementInfo *)elementInfo
     553- (RetainPtr<NSArray<_WKElementAction *>>)defaultActionsForImageSheet:(_WKActivatedElementInfo *)elementInfo
    554554{
    555555    NSURL *targetURL = [elementInfo URL];
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentView.h

    r245272 r246252  
    5555@package
    5656    RefPtr<WebKit::WebPageProxy> _page;
    57     WKWebView *_webView;
     57    WKWebView *_webView; // FIXME: This should be made a WeakObjCPtr once everything that refers to it is moved to OpenSource.
    5858}
    5959
  • branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r246251 r246252  
    4343#import "UIKitSPI.h"
    4444#import "WKActionSheetAssistant.h"
     45#import "WKContextMenuElementInfoInternal.h"
    4546#import "WKDatePickerViewController.h"
    4647#import "WKDrawingCoordinator.h"
     
    75217522            if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForAnimatedImageAtURL:defaultActions:elementInfo:imageSize:)]) {
    75227523                RetainPtr<NSArray> actions = [_actionSheetAssistant defaultActionsForImageSheet:animatedImageElementInfo.get()];
     7524                ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    75237525                return [uiDelegate _webView:_webView previewViewControllerForAnimatedImageAtURL:targetURL defaultActions:actions.get() elementInfo:animatedImageElementInfo.get() imageSize:_positionInformation.image->size()];
     7526                ALLOW_DEPRECATED_DECLARATIONS_END
    75247527            }
    75257528        }
     
    75437546        }
    75447547
     7548        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    75457549        if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForURL:defaultActions:elementInfo:)])
    75467550            return [uiDelegate _webView:_webView previewViewControllerForURL:targetURL defaultActions:actions.get() elementInfo:elementInfo.get()];
     
    75487552        if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForURL:)])
    75497553            return [uiDelegate _webView:_webView previewViewControllerForURL:targetURL];
     7554        ALLOW_DEPRECATED_DECLARATIONS_END
     7555
    75507556        return nil;
    75517557    }
     
    75687574        _page->startInteractionWithElementAtPosition(_positionInformation.request.point);
    75697575
     7576        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    75707577        if ([uiDelegate respondsToSelector:@selector(_webView:willPreviewImageWithURL:)])
    75717578            [uiDelegate _webView:_webView willPreviewImageWithURL:targetURL];
     7579        ALLOW_DEPRECATED_DECLARATIONS_END
    75727580
    75737581        auto defaultActions = [_actionSheetAssistant defaultActionsForImageSheet:elementInfo.get()];
    75747582        if (imageInfo && [uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:)]) {
     7583            ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    75757584            UIViewController *previewViewController = [uiDelegate _webView:_webView previewViewControllerForImage:uiImage.get() alternateURL:alternateURL.get() defaultActions:defaultActions.get() elementInfo:elementInfo.get()];
     7585            ALLOW_DEPRECATED_DECLARATIONS_END
    75767586            if (previewViewController)
    75777587                return previewViewController;
     
    75927602            if (imageURL.isEmpty() || !(imageURL.protocolIsInHTTPFamily() || imageURL.protocolIs("data")))
    75937603                return;
     7604            ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    75947605            [uiDelegate _webView:_webView commitPreviewedImageWithURL:(NSURL *)imageURL];
     7606            ALLOW_DEPRECATED_DECLARATIONS_END
    75957607            return;
    75967608        }
     
    76067618
    76077619    if ([uiDelegate respondsToSelector:@selector(_webView:commitPreviewedViewController:)]) {
     7620        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    76087621        [uiDelegate _webView:_webView commitPreviewedViewController:viewController];
     7622        ALLOW_DEPRECATED_DECLARATIONS_END
    76097623        return;
    76107624    }
     
    76307644{
    76317645    id<WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([_webView UIDelegate]);
     7646    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    76327647    if ([uiDelegate respondsToSelector:@selector(_webView:didDismissPreviewViewController:committing:)])
    76337648        [uiDelegate _webView:_webView didDismissPreviewViewController:viewController committing:committing];
    76347649    else if ([uiDelegate respondsToSelector:@selector(_webView:didDismissPreviewViewController:)])
    76357650        [uiDelegate _webView:_webView didDismissPreviewViewController:viewController];
    7636    
     7651    ALLOW_DEPRECATED_DECLARATIONS_END
     7652
    76377653    [_webView _didDismissForcePressPreview];
    76387654}
  • branches/safari-608.1.27-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r246250 r246252  
    10721072                5C5D238C227A2CDA000B9BDA /* _WKCustomHeaderFields.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C5D2389227A1892000B9BDA /* _WKCustomHeaderFields.h */; settings = {ATTRIBUTES = (Private, ); }; };
    10731073                5C62FDF91EFC271C00CE072E /* WKURLSchemeTaskPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C62FDF81EFC263C00CE072E /* WKURLSchemeTaskPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1074                5C795D70229F373F003FF1C4 /* WKContextMenuElementInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE0C369229F2D4A003695F0 /* WKContextMenuElementInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
     1075                5C795D71229F3757003FF1C4 /* WKContextMenuElementInfoPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE0C36A229F2D4A003695F0 /* WKContextMenuElementInfoPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    10741076                5C7FB47021E97DC5009E3241 /* WebCookieJar.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7FB46F21E97C0C009E3241 /* WebCookieJar.h */; };
    10751077                5C8BC797218CBB4800813886 /* SafeBrowsing.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5C8BC796218CB58A00813886 /* SafeBrowsing.xcassets */; };
     
    35713573                5CD2864F1E722F440094FDC8 /* WKContentRuleListStoreInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentRuleListStoreInternal.h; sourceTree = "<group>"; };
    35723574                5CD286501E722F440094FDC8 /* WKContentRuleListStorePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentRuleListStorePrivate.h; sourceTree = "<group>"; };
     3575                5CE0C366229F2D3D003695F0 /* APIContextMenuElementInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIContextMenuElementInfo.cpp; sourceTree = "<group>"; };
     3576                5CE0C367229F2D3E003695F0 /* APIContextMenuElementInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIContextMenuElementInfo.h; sourceTree = "<group>"; };
     3577                5CE0C368229F2D4A003695F0 /* WKContextMenuElementInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKContextMenuElementInfo.mm; sourceTree = "<group>"; };
     3578                5CE0C369229F2D4A003695F0 /* WKContextMenuElementInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuElementInfo.h; sourceTree = "<group>"; };
     3579                5CE0C36A229F2D4A003695F0 /* WKContextMenuElementInfoPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuElementInfoPrivate.h; sourceTree = "<group>"; };
     3580                5CE0C36B229F2D4B003695F0 /* WKContextMenuElementInfoInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuElementInfoInternal.h; sourceTree = "<group>"; };
    35733581                5CE85B1F1C88E6430070BFCE /* PingLoad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PingLoad.h; sourceTree = "<group>"; };
    35743582                5CE9120B2293C1E0005BEC78 /* WKMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKMain.h; sourceTree = "<group>"; };
     
    62466254                                5CD2864F1E722F440094FDC8 /* WKContentRuleListStoreInternal.h */,
    62476255                                5CD286501E722F440094FDC8 /* WKContentRuleListStorePrivate.h */,
     6256                                5CE0C369229F2D4A003695F0 /* WKContextMenuElementInfo.h */,
     6257                                5CE0C368229F2D4A003695F0 /* WKContextMenuElementInfo.mm */,
     6258                                5CE0C36B229F2D4B003695F0 /* WKContextMenuElementInfoInternal.h */,
     6259                                5CE0C36A229F2D4A003695F0 /* WKContextMenuElementInfoPrivate.h */,
    62486260                                1AF4592D19464B2000F9D4A2 /* WKError.h */,
    62496261                                1AF4592C19464B2000F9D4A2 /* WKError.mm */,
     
    77117723                                7C3A06A61AAB903E009D74BA /* APIContentRuleListStore.h */,
    77127724                                076E884D1A13CADF005E90FC /* APIContextMenuClient.h */,
     7725                                5CE0C366229F2D3D003695F0 /* APIContextMenuElementInfo.cpp */,
     7726                                5CE0C367229F2D3E003695F0 /* APIContextMenuElementInfo.h */,
    77137727                                5C5D238A227A1D9B000B9BDA /* APICustomHeaderFields.h */,
    77147728                                7A821F4F1E2F7A5C00604577 /* APICustomProtocolManagerClient.h */,
     
    98859899                                1A445BA1184D5FC1004B3414 /* WKContextHistoryClient.h in Headers */,
    98869900                                1A445B9F184D5FB5004B3414 /* WKContextInjectedBundleClient.h in Headers */,
     9901                                5C795D70229F373F003FF1C4 /* WKContextMenuElementInfo.h in Headers */,
     9902                                5C795D71229F3757003FF1C4 /* WKContextMenuElementInfoPrivate.h in Headers */,
    98879903                                51A555F6128C6C47009ABCEC /* WKContextMenuItem.h in Headers */,
    98889904                                51A55601128C6D92009ABCEC /* WKContextMenuItemTypes.h in Headers */,
Note: See TracChangeset for help on using the changeset viewer.