Diff
Modified: branches/safari-608.1.27-branch/Source/WebKit/ChangeLog (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/ChangeLog 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/ChangeLog 2019-06-10 06:25:36 UTC (rev 246252)
@@ -1,5 +1,89 @@
2019-06-09 Babak Shafiei <bshaf...@apple.com>
+ 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
+
+ 2019-06-05 Alex Christensen <achristen...@webkit.org>
+
+ 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:
+
+2019-06-09 Babak Shafiei <bshaf...@apple.com>
+
Cherry-pick r246213. rdar://problem/50114230
Restrict fast clicks everywhere to desktop content mode
Modified: branches/safari-608.1.27-branch/Source/WebKit/Shared/API/APIObject.h (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/Shared/API/APIObject.h 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/Shared/API/APIObject.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -109,6 +109,9 @@
ContentRuleList,
ContentRuleListAction,
ContentRuleListStore,
+#if PLATFORM(IOS_FAMILY)
+ ContextMenuElementInfo,
+#endif
ContextMenuListener,
CookieManager,
CustomHeaderFields,
Modified: branches/safari-608.1.27-branch/Source/WebKit/Shared/API/Cocoa/WebKit.h (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/Shared/API/Cocoa/WebKit.h 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/Shared/API/Cocoa/WebKit.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -27,6 +27,7 @@
#import <WebKit/WKBackForwardListItem.h>
#import <WebKit/WKContentRuleList.h>
#import <WebKit/WKContentRuleListStore.h>
+#import <WebKit/WKContextMenuElementInfo.h>
#import <WebKit/WKError.h>
#import <WebKit/WKFoundation.h>
#import <WebKit/WKFrameInfo.h>
Modified: branches/safari-608.1.27-branch/Source/WebKit/Shared/Cocoa/APIObject.mm (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/Shared/Cocoa/APIObject.mm 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/Shared/Cocoa/APIObject.mm 2019-06-10 06:25:36 UTC (rev 246252)
@@ -33,6 +33,7 @@
#import "WKConnectionInternal.h"
#import "WKContentRuleListInternal.h"
#import "WKContentRuleListStoreInternal.h"
+#import "WKContextMenuElementInfoInternal.h"
#import "WKFrameInfoInternal.h"
#import "WKHTTPCookieStoreInternal.h"
#import "WKNSArray.h"
@@ -313,6 +314,12 @@
wrapper = [WKContentRuleListStore alloc];
break;
+#if PLATFORM(IOS_FAMILY)
+ case Type::ContextMenuElementInfo:
+ wrapper = [WKContextMenuElementInfo alloc];
+ break;
+#endif
+
case Type::CustomHeaderFields:
wrapper = [_WKCustomHeaderFields alloc];
break;
Modified: branches/safari-608.1.27-branch/Source/WebKit/Sources.txt (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/Sources.txt 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/Sources.txt 2019-06-10 06:25:36 UTC (rev 246252)
@@ -300,6 +300,7 @@
UIProcess/API/APIContentRuleList.cpp
UIProcess/API/APIContentRuleListAction.cpp
UIProcess/API/APIContentRuleListStore.cpp
+UIProcess/API/APIContextMenuElementInfo.cpp
UIProcess/API/APIExperimentalFeature.cpp
UIProcess/API/APIFrameInfo.cpp
UIProcess/API/APIHTTPCookieStore.cpp
Modified: branches/safari-608.1.27-branch/Source/WebKit/SourcesCocoa.txt (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/SourcesCocoa.txt 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/SourcesCocoa.txt 2019-06-10 06:25:36 UTC (rev 246252)
@@ -282,6 +282,7 @@
UIProcess/API/Cocoa/WKConnection.mm
UIProcess/API/Cocoa/WKContentRuleList.mm
UIProcess/API/Cocoa/WKContentRuleListStore.mm
+UIProcess/API/Cocoa/WKContextMenuElementInfo.mm
UIProcess/API/Cocoa/WKError.mm
UIProcess/API/Cocoa/WKFrameInfo.mm
UIProcess/API/Cocoa/WKHTTPCookieStore.mm
Copied: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/APIContextMenuElementInfo.cpp (from rev 246251, branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreviewElementInfo.h) (0 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/APIContextMenuElementInfo.cpp (rev 0)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/APIContextMenuElementInfo.cpp 2019-06-10 06:25:36 UTC (rev 246252)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "APIContextMenuElementInfo.h"
+
+#if PLATFORM(IOS_FAMILY)
+
+namespace API {
+
+ContextMenuElementInfo::ContextMenuElementInfo(const WebKit::InteractionInformationAtPosition& info)
+ : m_interactionInformation(info)
+{
+}
+
+} // namespace API
+
+#endif // PLATFORM(IOS_FAMILY)
Copied: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/APIContextMenuElementInfo.h (from rev 246251, branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreviewElementInfo.h) (0 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/APIContextMenuElementInfo.h (rev 0)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/APIContextMenuElementInfo.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if PLATFORM(IOS_FAMILY)
+
+#include "APIObject.h"
+#include "InteractionInformationAtPosition.h"
+
+namespace API {
+
+class ContextMenuElementInfo final : public ObjectImpl<Object::Type::ContextMenuElementInfo> {
+public:
+ template<typename... Args> static Ref<ContextMenuElementInfo> create(Args&&... args)
+ {
+ return adoptRef(*new ContextMenuElementInfo(std::forward<Args>(args)...));
+ }
+
+ const WTF::URL& url() const { return m_interactionInformation.url; }
+
+ const WebKit::InteractionInformationAtPosition& interactionInformation() const { return m_interactionInformation; }
+
+private:
+ ContextMenuElementInfo(const WebKit::InteractionInformationAtPosition&);
+
+ WebKit::InteractionInformationAtPosition m_interactionInformation;
+};
+
+} // namespace API
+
+#endif
Copied: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfo.h (from rev 246251, branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreviewElementInfo.h) (0 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfo.h (rev 0)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfo.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit/WKFoundation.h>
+
+#if TARGET_OS_IPHONE
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+WK_CLASS_AVAILABLE(ios(WK_IOS_TBA))
+@interface WKContextMenuElementInfo : NSObject
+
+- (instancetype)init NS_UNAVAILABLE;
+
+@property (nonatomic, readonly, nullable) NSURL *linkURL;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif
+
Copied: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfo.mm (from rev 246251, branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreviewElementInfo.h) (0 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfo.mm (rev 0)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfo.mm 2019-06-10 06:25:36 UTC (rev 246252)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WKContextMenuElementInfoInternal.h"
+
+#if PLATFORM(IOS_FAMILY)
+
+#import "_WKActivatedElementInfoInternal.h"
+
+@implementation WKContextMenuElementInfo
+
+- (NSURL *)linkURL
+{
+ return _elementInfo->url();
+}
+
+- (API::Object&)_apiObject
+{
+ return *_elementInfo;
+}
+
+@end
+
+@implementation WKContextMenuElementInfo (WKPrivate)
+
+- (_WKActivatedElementInfo *)_activatedElementInfo
+{
+ return [_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:_elementInfo->interactionInformation()];
+}
+
+@end
+
+#endif
+
Copied: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h (from rev 246251, branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreviewElementInfo.h) (0 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h (rev 0)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfoInternal.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "APIContextMenuElementInfo.h"
+#import "WKContextMenuElementInfo.h"
+#import "WKObject.h"
+
+#if PLATFORM(IOS_FAMILY)
+
+namespace WebKit {
+
+template<> struct WrapperTraits<API::ContextMenuElementInfo> {
+ using WrapperClass = WKContextMenuElementInfo;
+};
+
+}
+
+@interface WKContextMenuElementInfo () <WKObject> {
+@package
+ API::ObjectStorage<API::ContextMenuElementInfo> _elementInfo;
+}
+@end
+
+#endif // PLATFORM(IOS_FAMILY)
Copied: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h (from rev 246251, branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreviewElementInfo.h) (0 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h (rev 0)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKContextMenuElementInfoPrivate.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit/WKContextMenuElementInfo.h>
+
+@class _WKActivatedElementInfo;
+
+@interface WKContextMenuElementInfo (WKPrivate)
+
+@property (nonatomic, copy, readonly) _WKActivatedElementInfo *_activatedElementInfo;
+
+@end
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreviewElementInfo.h (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreviewElementInfo.h 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreviewElementInfo.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -31,7 +31,7 @@
NS_ASSUME_NONNULL_BEGIN
-WK_CLASS_AVAILABLE(ios(10.0))
+WK_CLASS_DEPRECATED_WITH_REPLACEMENT("WKContextMenuElementInfo", ios(10.0, WK_IOS_TBA))
@interface WKPreviewElementInfo : NSObject <NSCopying>
@property (nonatomic, readonly, nullable) NSURL *linkURL;
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -40,8 +40,11 @@
@class _WKFrameHandle;
#if TARGET_OS_IOS
+@class UIContextMenuConfiguration;
@class UIDragItem;
@class UITargetedDragPreview;
+@class WKContextMenuElementInfo;
+@protocol UIContextMenuInteractionCommitAnimating;
@protocol UIDragSession;
@protocol UIDropSession;
#else
@@ -135,12 +138,24 @@
- (void)_webView:(WKWebView *)webView didNotHandleTapAsClickAtPoint:(CGPoint)point;
- (BOOL)_webView:(WKWebView *)webView shouldRequestGeolocationAuthorizationForURL:(NSURL *)url isMainFrame:(BOOL)isMainFrame mainFrameURL:(NSURL *)mainFrameURL;
- (void)_webView:(WKWebView *)webView requestGeolocationAuthorizationForURL:(NSURL *)url frame:(WKFrameInfo *)frame decisionHandler:(void (^)(BOOL authorized))decisionHandler WK_API_AVAILABLE(ios(11.0));
-- (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForURL:(NSURL *)url WK_API_AVAILABLE(ios(9.0));
-- (void)_webView:(WKWebView *)webView commitPreviewedViewController:(UIViewController *)previewedViewController WK_API_AVAILABLE(ios(9.0));
-- (void)_webView:(WKWebView *)webView willPreviewImageWithURL:(NSURL *)imageURL WK_API_AVAILABLE(ios(9.0));
-- (void)_webView:(WKWebView *)webView commitPreviewedImageWithURL:(NSURL *)imageURL WK_API_AVAILABLE(ios(9.0));
-- (void)_webView:(WKWebView *)webView didDismissPreviewViewController:(UIViewController *)previewedViewController committing:(BOOL)committing WK_API_AVAILABLE(ios(9.0));
-- (void)_webView:(WKWebView *)webView didDismissPreviewViewController:(UIViewController *)previewedViewController WK_API_AVAILABLE(ios(9.0));
+
+- (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForURL:(NSURL *)url WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuConfigurationForElement:completionHandler:", ios(9.0, WK_IOS_TBA));
+- (void)_webView:(WKWebView *)webView commitPreviewedViewController:(UIViewController *)previewedViewController WK_API_DEPRECATED_WITH_REPLACEMENT("webView:commitContextMenu:", ios(9.0, WK_IOS_TBA));
+- (void)_webView:(WKWebView *)webView willPreviewImageWithURL:(NSURL *)imageURL WK_API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuConfigurationForElement:completionHandler:", ios(9.0, WK_IOS_TBA));
+- (void)_webView:(WKWebView *)webView commitPreviewedImageWithURL:(NSURL *)imageURL WK_API_DEPRECATED_WITH_REPLACEMENT("webView:commitContextMenu:", ios(9.0, WK_IOS_TBA));
+- (void)_webView:(WKWebView *)webView didDismissPreviewViewController:(UIViewController *)previewedViewController committing:(BOOL)committing WK_API_DEPRECATED_WITH_REPLACEMENT("webView:dismissContextMenu:", ios(9.0, WK_IOS_TBA));
+- (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.
+- (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));
+#endif
+
- (BOOL)_webView:(WKWebView *)webView showCustomSheetForElement:(_WKActivatedElementInfo *)element WK_API_AVAILABLE(ios(10.0));
- (void)_webView:(WKWebView *)webView alternateActionForURL:(NSURL *)url WK_API_AVAILABLE(ios(10.0));
- (NSArray *)_attachmentListForWebView:(WKWebView *)webView WK_API_AVAILABLE(ios(10.0));
@@ -147,12 +162,12 @@
- (NSArray *)_attachmentListForWebView:(WKWebView *)webView sourceIsManaged:(BOOL*)sourceIsManaged WK_API_AVAILABLE(ios(10.3));
- (NSUInteger)_webView:(WKWebView *)webView indexIntoAttachmentListForElement:(_WKActivatedElementInfo *)element WK_API_AVAILABLE(ios(10.3));
- (UIEdgeInsets)_webView:(WKWebView *)webView finalObscuredInsetsForScrollView:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset WK_API_AVAILABLE(ios(9.0));
-- (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForURL:(NSURL *)url defaultActions:(NSArray<_WKElementAction *> *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo WK_API_AVAILABLE(ios(9.0));
-- (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForAnimatedImageAtURL:(NSURL *)url defaultActions:(NSArray<_WKElementAction *> *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo imageSize:(CGSize)imageSize WK_API_AVAILABLE(ios(9.0));
+- (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));
+- (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));
- (UIViewController *)_presentingViewControllerForWebView:(WKWebView *)webView WK_API_AVAILABLE(ios(10.0));
- (void)_webView:(WKWebView *)webView getAlternateURLFromImage:(UIImage *)image completionHandler:(void (^)(NSURL *alternateURL, NSDictionary *userInfo))completionHandler WK_API_AVAILABLE(ios(11.0));
- (NSURL *)_webView:(WKWebView *)webView alternateURLFromImage:(UIImage *)image userInfo:(NSDictionary **)userInfo WK_API_AVAILABLE(ios(11.0));
-- (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForImage:(UIImage *)image alternateURL:(NSURL *)url defaultActions:(NSArray<_WKElementAction *> *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo WK_API_AVAILABLE(ios(11.0));
+- (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));
- (NSArray *)_webView:(WKWebView *)webView adjustedDataInteractionItemProviders:(NSArray *)originalItemProviders WK_API_AVAILABLE(ios(11.0));
- (NSArray *)_webView:(WKWebView *)webView adjustedDataInteractionItemProvidersForItemProvider:(id)itemProvider representingObjects:(NSArray *)representingObjects additionalData:(NSDictionary *)additionalData WK_API_AVAILABLE(ios(11.0));
- (BOOL)_webView:(WKWebView *)webView performDataInteractionOperationWithItemProviders:(NSArray *)itemProviders WK_API_AVAILABLE(ios(11.0));
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/_WKActivatedElementInfo.h (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/_WKActivatedElementInfo.h 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/_WKActivatedElementInfo.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -47,6 +47,7 @@
@property (nonatomic, readonly) _WKActivatedElementType type;
@property (nonatomic, readonly) CGRect boundingRect;
@property (nonatomic, readonly) NSString *ID WK_API_AVAILABLE(macos(10.12), ios(10.0));
+@property (nonatomic, readonly) BOOL isAnimatedImage WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
#if TARGET_OS_IPHONE
@property (nonatomic, readonly) NSDictionary *userInfo WK_API_AVAILABLE(ios(11.0));
@property (nonatomic, readonly, copy) UIImage *image;
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/_WKActivatedElementInfo.mm (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/_WKActivatedElementInfo.mm 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/_WKActivatedElementInfo.mm 2019-06-10 06:25:36 UTC (rev 246252)
@@ -51,6 +51,7 @@
#if PLATFORM(MAC)
RetainPtr<NSImage> _nsImage;
#endif
+ BOOL _animatedImage;
}
#if PLATFORM(IOS_FAMILY)
@@ -81,6 +82,7 @@
_image = information.image;
_ID = information.idAttribute;
+ _animatedImage = information.isAnimatedImage;
return self;
}
@@ -136,6 +138,11 @@
return _interactionLocation;
}
+- (BOOL)isAnimatedImage
+{
+ return _animatedImage;
+}
+
#if PLATFORM(IOS_FAMILY)
- (NSDictionary *)userInfo
{
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -140,6 +140,7 @@
class WebFrameProxy;
class WebPageProxy;
class WebProcessPool;
+class WebProcessProxy;
struct ColorSpaceData;
struct WebHitTestResultData;
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2019-06-10 06:25:36 UTC (rev 246252)
@@ -1569,7 +1569,7 @@
{
NSView *webView = m_view.getAutoreleased();
- if (direction == FocusDirectionForward) {
+ if (direction == WebCore::FocusDirectionForward) {
// Since we're trying to move focus out of m_webView, and because
// m_webView may contain subviews within it, we ask it for the next key
// view of the last view in its key view loop. This makes m_webView
@@ -3611,7 +3611,7 @@
if ([attribute isEqualToString:@"AXConvertRelativeFrame"]) {
if ([parameter isKindOfClass:[NSValue class]]) {
NSRect rect = [(NSValue *)parameter rectValue];
- return [NSValue valueWithRect:m_pageClient->rootViewToScreen(IntRect(rect))];
+ return [NSValue valueWithRect:m_pageClient->rootViewToScreen(WebCore::IntRect(rect))];
}
}
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -38,6 +38,7 @@
@class WKActionSheetAssistant;
@class _WKActivatedElementInfo;
+@class _WKElementAction;
@protocol WKActionSheetDelegate;
@protocol WKActionSheetAssistantDelegate <NSObject>
@@ -76,8 +77,8 @@
- (void)showDataDetectorsSheet;
- (void)cleanupSheet;
- (void)updateSheetPosition;
-- (RetainPtr<NSArray>)defaultActionsForLinkSheet:(_WKActivatedElementInfo *)elementInfo;
-- (RetainPtr<NSArray>)defaultActionsForImageSheet:(_WKActivatedElementInfo *)elementInfo;
+- (RetainPtr<NSArray<_WKElementAction *>>)defaultActionsForLinkSheet:(_WKActivatedElementInfo *)elementInfo;
+- (RetainPtr<NSArray<_WKElementAction *>>)defaultActionsForImageSheet:(_WKActivatedElementInfo *)elementInfo;
- (BOOL)isShowingSheet;
- (void)interactionDidStartWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)information;
- (NSArray *)currentAvailableActionTitles;
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm 2019-06-10 06:25:36 UTC (rev 246252)
@@ -529,7 +529,7 @@
[defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeOpen assistant:self]];
}
-- (RetainPtr<NSArray>)defaultActionsForLinkSheet:(_WKActivatedElementInfo *)elementInfo
+- (RetainPtr<NSArray<_WKElementAction *>>)defaultActionsForLinkSheet:(_WKActivatedElementInfo *)elementInfo
{
NSURL *targetURL = [elementInfo URL];
if (!targetURL)
@@ -550,7 +550,7 @@
return defaultActions;
}
-- (RetainPtr<NSArray>)defaultActionsForImageSheet:(_WKActivatedElementInfo *)elementInfo
+- (RetainPtr<NSArray<_WKElementAction *>>)defaultActionsForImageSheet:(_WKActivatedElementInfo *)elementInfo
{
NSURL *targetURL = [elementInfo URL];
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentView.h (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentView.h 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentView.h 2019-06-10 06:25:36 UTC (rev 246252)
@@ -54,7 +54,7 @@
@interface WKContentView : WKApplicationStateTrackingView {
@package
RefPtr<WebKit::WebPageProxy> _page;
- WKWebView *_webView;
+ WKWebView *_webView; // FIXME: This should be made a WeakObjCPtr once everything that refers to it is moved to OpenSource.
}
#pragma clang diagnostic push
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-06-10 06:25:36 UTC (rev 246252)
@@ -42,6 +42,7 @@
#import "TextInputSPI.h"
#import "UIKitSPI.h"
#import "WKActionSheetAssistant.h"
+#import "WKContextMenuElementInfoInternal.h"
#import "WKDatePickerViewController.h"
#import "WKDrawingCoordinator.h"
#import "WKError.h"
@@ -7520,7 +7521,9 @@
if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForAnimatedImageAtURL:defaultActions:elementInfo:imageSize:)]) {
RetainPtr<NSArray> actions = [_actionSheetAssistant defaultActionsForImageSheet:animatedImageElementInfo.get()];
+ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
return [uiDelegate _webView:_webView previewViewControllerForAnimatedImageAtURL:targetURL defaultActions:actions.get() elementInfo:animatedImageElementInfo.get() imageSize:_positionInformation.image->size()];
+ ALLOW_DEPRECATED_DECLARATIONS_END
}
}
@@ -7542,11 +7545,14 @@
ALLOW_DEPRECATED_DECLARATIONS_END
}
+ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForURL:defaultActions:elementInfo:)])
return [uiDelegate _webView:_webView previewViewControllerForURL:targetURL defaultActions:actions.get() elementInfo:elementInfo.get()];
if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForURL:)])
return [uiDelegate _webView:_webView previewViewControllerForURL:targetURL];
+ ALLOW_DEPRECATED_DECLARATIONS_END
+
return nil;
}
@@ -7567,12 +7573,16 @@
RetainPtr<_WKActivatedElementInfo> elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:alternateURL.get() imageURL:nil location:_positionInformation.request.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:_positionInformation.image.get() userInfo:imageInfo.get()]);
_page->startInteractionWithElementAtPosition(_positionInformation.request.point);
+ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
if ([uiDelegate respondsToSelector:@selector(_webView:willPreviewImageWithURL:)])
[uiDelegate _webView:_webView willPreviewImageWithURL:targetURL];
+ ALLOW_DEPRECATED_DECLARATIONS_END
auto defaultActions = [_actionSheetAssistant defaultActionsForImageSheet:elementInfo.get()];
if (imageInfo && [uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:)]) {
+ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
UIViewController *previewViewController = [uiDelegate _webView:_webView previewViewControllerForImage:uiImage.get() alternateURL:alternateURL.get() defaultActions:defaultActions.get() elementInfo:elementInfo.get()];
+ ALLOW_DEPRECATED_DECLARATIONS_END
if (previewViewController)
return previewViewController;
}
@@ -7591,7 +7601,9 @@
const URL& imageURL = _positionInformation.imageURL;
if (imageURL.isEmpty() || !(imageURL.protocolIsInHTTPFamily() || imageURL.protocolIs("data")))
return;
+ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
[uiDelegate _webView:_webView commitPreviewedImageWithURL:(NSURL *)imageURL];
+ ALLOW_DEPRECATED_DECLARATIONS_END
return;
}
return;
@@ -7605,7 +7617,9 @@
}
if ([uiDelegate respondsToSelector:@selector(_webView:commitPreviewedViewController:)]) {
+ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
[uiDelegate _webView:_webView commitPreviewedViewController:viewController];
+ ALLOW_DEPRECATED_DECLARATIONS_END
return;
}
@@ -7629,11 +7643,13 @@
- (void)_previewItemController:(UIPreviewItemController *)controller didDismissPreview:(UIViewController *)viewController committing:(BOOL)committing
{
id<WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([_webView UIDelegate]);
+ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
if ([uiDelegate respondsToSelector:@selector(_webView:didDismissPreviewViewController:committing:)])
[uiDelegate _webView:_webView didDismissPreviewViewController:viewController committing:committing];
else if ([uiDelegate respondsToSelector:@selector(_webView:didDismissPreviewViewController:)])
[uiDelegate _webView:_webView didDismissPreviewViewController:viewController];
-
+ ALLOW_DEPRECATED_DECLARATIONS_END
+
[_webView _didDismissForcePressPreview];
}
Modified: branches/safari-608.1.27-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj (246251 => 246252)
--- branches/safari-608.1.27-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-06-10 06:25:30 UTC (rev 246251)
+++ branches/safari-608.1.27-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-06-10 06:25:36 UTC (rev 246252)
@@ -1071,6 +1071,8 @@
5C4B9D8B210A8CCF008F14D1 /* UndoOrRedo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4B9D8A210A8C46008F14D1 /* UndoOrRedo.h */; };
5C5D238C227A2CDA000B9BDA /* _WKCustomHeaderFields.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C5D2389227A1892000B9BDA /* _WKCustomHeaderFields.h */; settings = {ATTRIBUTES = (Private, ); }; };
5C62FDF91EFC271C00CE072E /* WKURLSchemeTaskPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C62FDF81EFC263C00CE072E /* WKURLSchemeTaskPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 5C795D70229F373F003FF1C4 /* WKContextMenuElementInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE0C369229F2D4A003695F0 /* WKContextMenuElementInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 5C795D71229F3757003FF1C4 /* WKContextMenuElementInfoPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE0C36A229F2D4A003695F0 /* WKContextMenuElementInfoPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
5C7FB47021E97DC5009E3241 /* WebCookieJar.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7FB46F21E97C0C009E3241 /* WebCookieJar.h */; };
5C8BC797218CBB4800813886 /* SafeBrowsing.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5C8BC796218CB58A00813886 /* SafeBrowsing.xcassets */; };
5C8DD3801FE4521600F2A556 /* WebsiteAutoplayPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C8DD37F1FE4519200F2A556 /* WebsiteAutoplayPolicy.h */; };
@@ -3570,6 +3572,12 @@
5CD2864E1E722F440094FDC8 /* WKContentRuleListStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKContentRuleListStore.mm; sourceTree = "<group>"; };
5CD2864F1E722F440094FDC8 /* WKContentRuleListStoreInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentRuleListStoreInternal.h; sourceTree = "<group>"; };
5CD286501E722F440094FDC8 /* WKContentRuleListStorePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentRuleListStorePrivate.h; sourceTree = "<group>"; };
+ 5CE0C366229F2D3D003695F0 /* APIContextMenuElementInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIContextMenuElementInfo.cpp; sourceTree = "<group>"; };
+ 5CE0C367229F2D3E003695F0 /* APIContextMenuElementInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIContextMenuElementInfo.h; sourceTree = "<group>"; };
+ 5CE0C368229F2D4A003695F0 /* WKContextMenuElementInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKContextMenuElementInfo.mm; sourceTree = "<group>"; };
+ 5CE0C369229F2D4A003695F0 /* WKContextMenuElementInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuElementInfo.h; sourceTree = "<group>"; };
+ 5CE0C36A229F2D4A003695F0 /* WKContextMenuElementInfoPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuElementInfoPrivate.h; sourceTree = "<group>"; };
+ 5CE0C36B229F2D4B003695F0 /* WKContextMenuElementInfoInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuElementInfoInternal.h; sourceTree = "<group>"; };
5CE85B1F1C88E6430070BFCE /* PingLoad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PingLoad.h; sourceTree = "<group>"; };
5CE9120B2293C1E0005BEC78 /* WKMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKMain.h; sourceTree = "<group>"; };
5CE9120C2293C1E0005BEC78 /* WKMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKMain.mm; sourceTree = "<group>"; };
@@ -6245,6 +6253,10 @@
5CD2864E1E722F440094FDC8 /* WKContentRuleListStore.mm */,
5CD2864F1E722F440094FDC8 /* WKContentRuleListStoreInternal.h */,
5CD286501E722F440094FDC8 /* WKContentRuleListStorePrivate.h */,
+ 5CE0C369229F2D4A003695F0 /* WKContextMenuElementInfo.h */,
+ 5CE0C368229F2D4A003695F0 /* WKContextMenuElementInfo.mm */,
+ 5CE0C36B229F2D4B003695F0 /* WKContextMenuElementInfoInternal.h */,
+ 5CE0C36A229F2D4A003695F0 /* WKContextMenuElementInfoPrivate.h */,
1AF4592D19464B2000F9D4A2 /* WKError.h */,
1AF4592C19464B2000F9D4A2 /* WKError.mm */,
1A2D252A194688FD004537B0 /* WKErrorInternal.h */,
@@ -7710,6 +7722,8 @@
7C3A06A51AAB903E009D74BA /* APIContentRuleListStore.cpp */,
7C3A06A61AAB903E009D74BA /* APIContentRuleListStore.h */,
076E884D1A13CADF005E90FC /* APIContextMenuClient.h */,
+ 5CE0C366229F2D3D003695F0 /* APIContextMenuElementInfo.cpp */,
+ 5CE0C367229F2D3E003695F0 /* APIContextMenuElementInfo.h */,
5C5D238A227A1D9B000B9BDA /* APICustomHeaderFields.h */,
7A821F4F1E2F7A5C00604577 /* APICustomProtocolManagerClient.h */,
83891B621A68B3420030F386 /* APIDiagnosticLoggingClient.h */,
@@ -9884,6 +9898,8 @@
1A445BA3184D5FCF004B3414 /* WKContextDownloadClient.h in Headers */,
1A445BA1184D5FC1004B3414 /* WKContextHistoryClient.h in Headers */,
1A445B9F184D5FB5004B3414 /* WKContextInjectedBundleClient.h in Headers */,
+ 5C795D70229F373F003FF1C4 /* WKContextMenuElementInfo.h in Headers */,
+ 5C795D71229F3757003FF1C4 /* WKContextMenuElementInfoPrivate.h in Headers */,
51A555F6128C6C47009ABCEC /* WKContextMenuItem.h in Headers */,
51A55601128C6D92009ABCEC /* WKContextMenuItemTypes.h in Headers */,
A1EA02381DABFF7E0096021F /* WKContextMenuListener.h in Headers */,