From 12da69deb41dea5c0cb8805f1c1f813adfdc8fe2 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Fri, 24 Jul 2020 09:05:45 -0400 Subject: [PATCH] [wkwebkit] Update for Xcode 12 beta 3 --- src/WKWebKit/Defs.cs | 4 +++ src/wkwebkit.cs | 46 +++++++++++++++------------- tests/xtro-sharpie/iOS-WebKit.todo | 1 - tests/xtro-sharpie/macOS-WebKit.todo | 1 - 4 files changed, 29 insertions(+), 23 deletions(-) delete mode 100644 tests/xtro-sharpie/iOS-WebKit.todo delete mode 100644 tests/xtro-sharpie/macOS-WebKit.todo diff --git a/src/WKWebKit/Defs.cs b/src/WKWebKit/Defs.cs index c48cde09c5c5..4cc5a00dab67 100644 --- a/src/WKWebKit/Defs.cs +++ b/src/WKWebKit/Defs.cs @@ -68,6 +68,10 @@ public enum WKErrorCode : long { // Xcode 11 AttributedStringContentFailedToLoad, AttributedStringContentLoadTimedOut, + // Xcode 12 + JavaScriptInvalidFrameTarget, + NavigationAppBoundDomain, + JavaScriptAppBoundDomain, } #if !MONOMAC || !XAMCORE_4_0 diff --git a/src/wkwebkit.cs b/src/wkwebkit.cs index d164412a6617..f6099c70fdd9 100644 --- a/src/wkwebkit.cs +++ b/src/wkwebkit.cs @@ -229,7 +229,7 @@ interface WKNavigationDelegate { [Export ("webViewWebContentProcessDidTerminate:")] void ContentProcessDidTerminate (WKWebView webView); - [Mac (10,16)][iOS (14,0)] + [Mac (11,0)][iOS (14,0)] [Export ("webView:authenticationChallenge:shouldAllowDeprecatedTLS:")] void ShouldAllowDeprecatedTls (WKWebView webView, NSUrlAuthenticationChallenge challenge, Action decisionHandler); } @@ -254,7 +254,7 @@ interface WKPreferences : NSSecureCoding { [Export ("minimumFontSize")] nfloat MinimumFontSize { get; set; } - [Deprecated (PlatformName.MacOSX, 10,16, message: "Use 'WKWebPagePreferences.AllowsContentJavaScript' instead.")] + [Deprecated (PlatformName.MacOSX, 11,0, message: "Use 'WKWebPagePreferences.AllowsContentJavaScript' instead.")] [Deprecated (PlatformName.iOS, 14,0, message: "Use 'WKWebPagePreferences.AllowsContentJavaScript' instead.")] [Export ("javaScriptEnabled")] bool JavaScriptEnabled { get; set; } @@ -300,7 +300,7 @@ interface WKScriptMessage { [Export ("frameInfo", ArgumentSemantic.Copy)] WKFrameInfo FrameInfo { get; } - [Mac (10,16)][iOS (14,0)] + [Mac (11,0)][iOS (14,0)] [Export ("world")] WKContentWorld World { get; } } @@ -561,18 +561,18 @@ interface WKUserContentController : NSSecureCoding { [Export ("addScriptMessageHandler:name:")] void AddScriptMessageHandler ([Protocolize] WKScriptMessageHandler scriptMessageHandler, string name); - [Mac (10,16), iOS (14,0)] + [Mac (11,0), iOS (14,0)] [Export ("addScriptMessageHandler:contentWorld:name:")] void AddScriptMessageHandler (IWKScriptMessageHandler scriptMessageHandler, WKContentWorld world, string name); - [Mac (10,16), iOS (14,0)] + [Mac (11,0), iOS (14,0)] [Export ("addScriptMessageHandlerWithReply:contentWorld:name:")] void AddScriptMessageHandler (IWKScriptMessageHandlerWithReply scriptMessageHandlerWithReply, WKContentWorld contentWorld, string name); [Export ("removeScriptMessageHandlerForName:")] void RemoveScriptMessageHandler (string name); - [Mac (10,16), iOS (14,0)] + [Mac (11,0), iOS (14,0)] [Export ("removeScriptMessageHandlerForName:contentWorld:")] void RemoveScriptMessageHandler (string name, WKContentWorld contentWorld); @@ -588,11 +588,11 @@ interface WKUserContentController : NSSecureCoding { [Export ("removeAllContentRuleLists")] void RemoveAllContentRuleLists (); - [Mac (10,16), iOS (14,0)] + [Mac (11,0), iOS (14,0)] [Export ("removeAllScriptMessageHandlersFromContentWorld:")] void RemoveAllScriptMessageHandlers (WKContentWorld contentWorld); - [Mac (10,16), iOS (14,0)] + [Mac (11,0), iOS (14,0)] [Export ("removeAllScriptMessageHandlers")] void RemoveAllScriptMessageHandlers (); } @@ -605,6 +605,10 @@ interface WKUserScript : NSCopying { [Export ("initWithSource:injectionTime:forMainFrameOnly:")] IntPtr Constructor (NSString source, WKUserScriptInjectionTime injectionTime, bool isForMainFrameOnly); + [Mac (11,0), iOS (14,0)] + [Export ("initWithSource:injectionTime:forMainFrameOnly:inContentWorld:")] + IntPtr Constructor (NSString source, WKUserScriptInjectionTime injectionTime, bool isForMainFrameOnly, WKContentWorld contentWorld); + [Export ("source", ArgumentSemantic.Copy)] NSString Source { get; } @@ -792,31 +796,31 @@ interface WKWebView [Export ("callAsyncJavaScript:arguments:inFrame:inContentWorld:completionHandler:")] void CallAsyncJavaScript (string functionBody, [NullAllowed] NSDictionary arguments, [NullAllowed] WKFrameInfo frame, WKContentWorld contentWorld, [NullAllowed] Action completionHandler); - [Mac (10,16), iOS (14,0)] + [Mac (11,0), iOS (14,0)] [Async] [Export ("createPDFWithConfiguration:completionHandler:")] void CreatePdf ([NullAllowed] WKPdfConfiguration pdfConfiguration, Action completionHandler); - [Mac (10,16), iOS (14,0)] + [Mac (11,0), iOS (14,0)] [Async] [Export ("createWebArchiveDataWithCompletionHandler:")] void CreateWebArchive (Action completionHandler); - [Mac (10,16), iOS (14,0)] + [Mac (11,0), iOS (14,0)] [Async] [Export ("findString:withConfiguration:completionHandler:")] void Find (string @string, [NullAllowed] WKFindConfiguration configuration, Action completionHandler); - [Mac (10, 16), iOS (14, 0)] + [Mac (11,0), iOS (14,0)] [NullAllowed, Export ("mediaType")] string MediaType { get; set; } - [Mac (10, 16), iOS (14, 0)] + [Mac (11,0), iOS (14,0)] [Export ("pageZoom")] nfloat PageZoom { get; set; } [NoiOS] - [Mac (10,16)] + [Mac (11,0)] [Export ("printOperationWithPrintInfo:")] NSPrintOperation GetPrintOperation (NSPrintInfo printInfo); } @@ -901,7 +905,7 @@ interface WKWebViewConfiguration : NSCopying, NSSecureCoding { [Export ("defaultWebpagePreferences", ArgumentSemantic.Copy)] WKWebpagePreferences DefaultWebpagePreferences { get; set; } - [Mac (10,16)] + [Mac (11,0)] [iOS (14,0)] [Export ("limitsNavigationsToAppBoundDomains")] bool LimitsNavigationsToAppBoundDomains { get; set; } @@ -999,7 +1003,7 @@ interface WKWebpagePreferences { [Export ("preferredContentMode", ArgumentSemantic.Assign)] WKContentMode PreferredContentMode { get; set; } - [Mac (10,16)] + [Mac (11,0)] [iOS (14,0)] [Export ("allowsContentJavaScript")] bool AllowsContentJavaScript { get; set; } @@ -1014,7 +1018,7 @@ interface WKContextMenuElementInfo { NSUrl LinkUrl { get; } } - [Mac (10,16)][iOS (14,0)] + [Mac (11,0)][iOS (14,0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface WKContentWorld { @@ -1035,7 +1039,7 @@ interface WKContentWorld { string Name { get; } } - [Mac (10,16)][iOS (14,0)] + [Mac (11,0)][iOS (14,0)] [BaseType (typeof (NSObject))] interface WKFindConfiguration : NSCopying { @@ -1049,7 +1053,7 @@ interface WKFindConfiguration : NSCopying { bool Wraps { get; set; } } - [Mac (10,16)][iOS (14,0)] + [Mac (11,0)][iOS (14,0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface WKFindResult : NSCopying { @@ -1058,7 +1062,7 @@ interface WKFindResult : NSCopying { bool MatchFound { get; } } - [Mac (10,16)][iOS (14,0)] + [Mac (11,0)][iOS (14,0)] [BaseType (typeof (NSObject), Name = "WKPDFConfiguration")] interface WKPdfConfiguration : NSCopying { @@ -1068,7 +1072,7 @@ interface WKPdfConfiguration : NSCopying { interface IWKScriptMessageHandlerWithReply {} - [Mac (10,16)][iOS (14,0)] + [Mac (11,0)][iOS (14,0)] [Protocol] interface WKScriptMessageHandlerWithReply { diff --git a/tests/xtro-sharpie/iOS-WebKit.todo b/tests/xtro-sharpie/iOS-WebKit.todo deleted file mode 100644 index cfb0a23b0b30..000000000000 --- a/tests/xtro-sharpie/iOS-WebKit.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-selector! WKUserScript::initWithSource:injectionTime:forMainFrameOnly:inContentWorld: not bound diff --git a/tests/xtro-sharpie/macOS-WebKit.todo b/tests/xtro-sharpie/macOS-WebKit.todo deleted file mode 100644 index cfb0a23b0b30..000000000000 --- a/tests/xtro-sharpie/macOS-WebKit.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-selector! WKUserScript::initWithSource:injectionTime:forMainFrameOnly:inContentWorld: not bound