From 8989ce93fd1551b0cc92dd0b290684db60a3a282 Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Tue, 17 Oct 2023 09:19:21 -0700 Subject: [PATCH 1/5] [WebKit] Add support for Xcode 15 --- src/webkit.cs | 108 +++++++++++++++++- .../MacCatalyst-WebKit.todo | 2 - .../common-WebKit.ignore | 5 + .../api-annotations-dotnet/iOS-WebKit.todo | 19 --- .../macOS-WebKit.ignore | 36 ++++++ .../api-annotations-dotnet/macOS-WebKit.todo | 54 --------- tests/xtro-sharpie/common-WebKit.ignore | 5 + tests/xtro-sharpie/iOS-WebKit.todo | 19 --- tests/xtro-sharpie/macOS-WebKit.ignore | 43 +++++++ tests/xtro-sharpie/macOS-WebKit.todo | 60 ---------- 10 files changed, 196 insertions(+), 155 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-WebKit.todo create mode 100644 tests/xtro-sharpie/api-annotations-dotnet/common-WebKit.ignore delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-WebKit.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.todo create mode 100644 tests/xtro-sharpie/common-WebKit.ignore delete mode 100644 tests/xtro-sharpie/iOS-WebKit.todo delete mode 100644 tests/xtro-sharpie/macOS-WebKit.todo diff --git a/src/webkit.cs b/src/webkit.cs index 95d154afe69f..3559c131e386 100644 --- a/src/webkit.cs +++ b/src/webkit.cs @@ -4380,6 +4380,31 @@ public enum WKDialogResult : long { Handled, } + [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] + [Native] + public enum WKCookiePolicy : long + { + Allow, + Disallow, + } + + [iOS(17,0), Mac(14, 0), MacCatalyst(17,0)] + [Native] + public enum WKInactiveSchedulingPolicy : long + { + Suspend, + Throttle, + None, + } + + [NoiOS, Mac(14, 0), NoMacCatalyst] + [Native] + public enum WKUserInterfaceDirectionPolicy : long + { + Content, + System, + } + [MacCatalyst (13, 1)] [BaseType (typeof (NSObject))] [DisableDefaultCtor ()] // Crashes during deallocation in Xcode 6 beta 2. radar 17377712. @@ -4480,6 +4505,16 @@ interface WKHttpCookieStore { [Export ("removeObserver:")] void RemoveObserver (IWKHttpCookieStoreObserver observer); + + [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] + [Export("setCookiePolicy:completionHandler:")] + [Async] + void SetCookiePolicy(WKCookiePolicy policy, [NullAllowed] Action completionHandler); + + [iOS(17,0), Mac(14, 0), MacCatalyst(17,0)] + [Export("getCookiePolicy:")] + [Async] + void GetCookiePolicy(Action completionHandler); } interface IWKHttpCookieStoreObserver { } @@ -4691,6 +4726,10 @@ interface WKPreferences : NSSecureCoding { [Mac (12, 3), iOS (15, 4), MacCatalyst (15, 4)] [Export ("elementFullscreenEnabled")] bool ElementFullscreenEnabled { [Bind ("isElementFullscreenEnabled")] get; set; } + + [Mac(14, 0), iOS(17,0), MacCatalyst(17,0)] + [Export("inactiveSchedulingPolicy", ArgumentSemantic.Assign)] + WKInactiveSchedulingPolicy InactiveSchedulingPolicy { get; set; } } [MacCatalyst (13, 1)] @@ -4851,6 +4890,38 @@ interface WKWebsiteDataType { [Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV] [Field ("WKWebsiteDataTypeFileSystem")] NSString FileSystem { get; } + + [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] + [Field("WKWebsiteDataTypeSearchFieldRecentSearches")] + NSString SearchFieldRecentSearches { get; } + + [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] + [Field("WKWebsiteDataTypeMediaKeys")] + NSString MediaKeys { get; } + + [iOS (17,0), Mac(14, 0), MacCatalyst(17, 0)] + [Field("WKWebsiteDataTypeHashSalt")] + NSString HashSalt { get; } + } + + [NoiOS, NoMacCatalyst, Mac (14,0)] + [Static] + interface WebViewNotification + { + [Field("WebViewDidBeginEditingNotification")] + NSString DidBeginEditing { get; } + + [Field("WebViewDidChangeNotification")] + NSString DidChange { get; } + + [Field("WebViewDidEndEditingNotification")] + NSString DidEndEditing { get; } + + [Field("WebViewDidChangeTypingStyleNotification")] + NSString DidChangeTypingStyle { get; } + + [Field("WebViewDidChangeSelectionNotification")] + NSString DidChangeSelection { get; } } [MacCatalyst (13, 1)] @@ -4888,6 +4959,27 @@ interface WKWebsiteDataStore : NSSecureCoding { [MacCatalyst (13, 1)] [Export ("httpCookieStore")] WKHttpCookieStore HttpCookieStore { get; } + + [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] + [NullAllowed, Export("identifier")] + NSUuid Identifier { get; } + + [iOS(17,0), Mac(14, 0), MacCatalyst(17, 0)] + [Static] + [Export("dataStoreForIdentifier:")] + WKWebsiteDataStore Create(NSUuid identifier); + + [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] + [Static] + [Async] + [Export("removeDataStoreForIdentifier:completionHandler:")] + void Remove(NSUuid identifier, Action completionHandler); + + [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] + [Static] + [Async] + [Export("fetchAllDataStoreIdentifiers:")] + void FetchAllDataStoreIdentifiers(Action> completionHandler); } [NoiOS, NoWatch, NoTV] @@ -5093,7 +5185,9 @@ interface WKUserScript : NSCopying { interface WKWebView #if MONOMAC : NSUserInterfaceValidations - /* TODO , NSTextFinderClient K_API_AVAILABLE(macos(WK_MAC_TBA)) in 11.4 beta 2 */ +#if XAMCORE_5_0 + , NSTextFinderClient +#endif #endif { @@ -5549,6 +5643,14 @@ interface WKWebViewConfiguration : NSCopying, NSSecureCoding { [Mac (12, 0), iOS (15, 0), MacCatalyst (15, 0), NoTV] [Export ("upgradeKnownHostsToHTTPS")] bool UpgradeKnownHostsToHttps { get; set; } + + [Mac(14, 0), iOS(17, 0), MacCatalyst(17,0)] + [Export("allowsInlinePredictions")] + bool AllowsInlinePredictions { get; set; } + + [NoiOS, Mac(14, 0)] + [Export("userInterfaceDirectionPolicy", ArgumentSemantic.Assign)] + WKUserInterfaceDirectionPolicy UserInterfaceDirectionPolicy { get; set; } } [MacCatalyst (13, 1)] @@ -5738,6 +5840,10 @@ interface WKPdfConfiguration : NSCopying { [Export ("rect", ArgumentSemantic.Assign)] CGRect Rect { get; set; } + + [iOS(17,0), Mac(14, 0), MacCatalyst(17,0)] + [Export("allowTransparentBackground")] + bool AllowTransparentBackground { get; set; } } interface IWKScriptMessageHandlerWithReply { } diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-WebKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-WebKit.todo deleted file mode 100644 index f881517792d6..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-WebKit.todo +++ /dev/null @@ -1,2 +0,0 @@ -!missing-selector! WKWebView::findInteraction not bound -!missing-selector! WKWebView::isFindInteractionEnabled not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/common-WebKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/common-WebKit.ignore new file mode 100644 index 000000000000..b94857831eb0 --- /dev/null +++ b/tests/xtro-sharpie/api-annotations-dotnet/common-WebKit.ignore @@ -0,0 +1,5 @@ +# xcode 15 +# requires OS_nw_proxy_config type which has not been bound yet, part of Xcode 15 Network binding +!missing-selector! WKWebsiteDataStore::proxyConfigurations not bound +!missing-selector! WKWebsiteDataStore::setProxyConfigurations: not bound + diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-WebKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-WebKit.todo deleted file mode 100644 index 0352fb8aff1a..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-WebKit.todo +++ /dev/null @@ -1,19 +0,0 @@ -!missing-enum! WKCookiePolicy not bound -!missing-enum! WKInactiveSchedulingPolicy not bound -!missing-field! WKWebsiteDataTypeHashSalt not bound -!missing-field! WKWebsiteDataTypeMediaKeys not bound -!missing-field! WKWebsiteDataTypeSearchFieldRecentSearches not bound -!missing-selector! +WKWebsiteDataStore::dataStoreForIdentifier: not bound -!missing-selector! +WKWebsiteDataStore::fetchAllDataStoreIdentifiers: not bound -!missing-selector! +WKWebsiteDataStore::removeDataStoreForIdentifier:completionHandler: not bound -!missing-selector! WKHTTPCookieStore::getCookiePolicy: not bound -!missing-selector! WKHTTPCookieStore::setCookiePolicy:completionHandler: not bound -!missing-selector! WKPDFConfiguration::allowTransparentBackground not bound -!missing-selector! WKPDFConfiguration::setAllowTransparentBackground: not bound -!missing-selector! WKPreferences::inactiveSchedulingPolicy not bound -!missing-selector! WKPreferences::setInactiveSchedulingPolicy: not bound -!missing-selector! WKWebsiteDataStore::identifier not bound -!missing-selector! WKWebsiteDataStore::proxyConfigurations not bound -!missing-selector! WKWebsiteDataStore::setProxyConfigurations: not bound -!missing-selector! WKWebViewConfiguration::allowsInlinePredictions not bound -!missing-selector! WKWebViewConfiguration::setAllowsInlinePredictions: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.ignore index 0790dcab3a24..e6d77fe31e08 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.ignore @@ -1,3 +1,39 @@ ## only a subset of the old, pre WKWebKit, is bound for macOS # TODO WKWebView should conform to NSTextFinderClient is marked as macos(WK_MAC_TBA) as of 11.4 beta3 + +# xcode 15 + +# older/legacy API +!missing-selector! +NSObject::isKeyExcludedFromWebScript: not bound +!missing-selector! +NSObject::isSelectorExcludedFromWebScript: not bound +!missing-selector! +NSObject::webScriptNameForKey: not bound +!missing-selector! +NSObject::webScriptNameForSelector: not bound +!missing-selector! NSObject::finalizeForWebScript not bound +!missing-selector! NSObject::invokeDefaultMethodWithArguments: not bound +!missing-selector! NSObject::invokeUndefinedMethodFromWebScript:withArguments: not bound +!missing-selector! NSObject::objectForWebScript not bound +!missing-selector! NSObject::webFrame not bound +!missing-selector! NSObject::webPlugInContainerLoadRequest:inFrame: not bound +!missing-selector! NSObject::webPlugInContainerSelectionColor not bound +!missing-selector! NSObject::webPlugInContainerShowStatus: not bound +!missing-selector! NSObject::webPlugInDestroy not bound +!missing-selector! NSObject::webPlugInInitialize not bound +!missing-selector! NSObject::webPlugInMainResourceDidFailWithError: not bound +!missing-selector! NSObject::webPlugInMainResourceDidFinishLoading not bound +!missing-selector! NSObject::webPlugInMainResourceDidReceiveData: not bound +!missing-selector! NSObject::webPlugInMainResourceDidReceiveResponse: not bound +!missing-selector! NSObject::webPlugInSetIsSelected: not bound +!missing-selector! NSObject::webPlugInStart not bound +!missing-selector! NSObject::webPlugInStop not bound + +# is bound, not sure what xtro is on +!missing-selector! WKWebView::goBack: not bound +!missing-selector! WKWebView::goForward: not bound +!missing-selector! WKWebView::reload: not bound +!missing-selector! WKWebView::reloadFromOrigin: not bound +!missing-selector! WKWebView::stopLoading: not bound + +# enabled for XAMCORE 5, else breaking change +!missing-protocol-conformance! WKWebView should conform to NSTextFinderClient (defined in 'WKNSTextFinderClient' category) + diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.todo deleted file mode 100644 index 6160d79b9154..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.todo +++ /dev/null @@ -1,54 +0,0 @@ -!missing-enum! WKCookiePolicy not bound -!missing-enum! WKInactiveSchedulingPolicy not bound -!missing-enum! WKUserInterfaceDirectionPolicy not bound -!missing-field! WebViewDidBeginEditingNotification not bound -!missing-field! WebViewDidChangeNotification not bound -!missing-field! WebViewDidChangeSelectionNotification not bound -!missing-field! WebViewDidChangeTypingStyleNotification not bound -!missing-field! WebViewDidEndEditingNotification not bound -!missing-field! WKWebsiteDataTypeHashSalt not bound -!missing-field! WKWebsiteDataTypeMediaKeys not bound -!missing-field! WKWebsiteDataTypeSearchFieldRecentSearches not bound -!missing-protocol-conformance! WKWebView should conform to NSTextFinderClient (defined in 'WKNSTextFinderClient' category) -!missing-selector! +NSObject::isKeyExcludedFromWebScript: not bound -!missing-selector! +NSObject::isSelectorExcludedFromWebScript: not bound -!missing-selector! +NSObject::webScriptNameForKey: not bound -!missing-selector! +NSObject::webScriptNameForSelector: not bound -!missing-selector! +WKWebsiteDataStore::dataStoreForIdentifier: not bound -!missing-selector! +WKWebsiteDataStore::fetchAllDataStoreIdentifiers: not bound -!missing-selector! +WKWebsiteDataStore::removeDataStoreForIdentifier:completionHandler: not bound -!missing-selector! NSObject::finalizeForWebScript not bound -!missing-selector! NSObject::invokeDefaultMethodWithArguments: not bound -!missing-selector! NSObject::invokeUndefinedMethodFromWebScript:withArguments: not bound -!missing-selector! NSObject::objectForWebScript not bound -!missing-selector! NSObject::webFrame not bound -!missing-selector! NSObject::webPlugInContainerLoadRequest:inFrame: not bound -!missing-selector! NSObject::webPlugInContainerSelectionColor not bound -!missing-selector! NSObject::webPlugInContainerShowStatus: not bound -!missing-selector! NSObject::webPlugInDestroy not bound -!missing-selector! NSObject::webPlugInInitialize not bound -!missing-selector! NSObject::webPlugInMainResourceDidFailWithError: not bound -!missing-selector! NSObject::webPlugInMainResourceDidFinishLoading not bound -!missing-selector! NSObject::webPlugInMainResourceDidReceiveData: not bound -!missing-selector! NSObject::webPlugInMainResourceDidReceiveResponse: not bound -!missing-selector! NSObject::webPlugInSetIsSelected: not bound -!missing-selector! NSObject::webPlugInStart not bound -!missing-selector! NSObject::webPlugInStop not bound -!missing-selector! WKHTTPCookieStore::getCookiePolicy: not bound -!missing-selector! WKHTTPCookieStore::setCookiePolicy:completionHandler: not bound -!missing-selector! WKPDFConfiguration::allowTransparentBackground not bound -!missing-selector! WKPDFConfiguration::setAllowTransparentBackground: not bound -!missing-selector! WKPreferences::inactiveSchedulingPolicy not bound -!missing-selector! WKPreferences::setInactiveSchedulingPolicy: not bound -!missing-selector! WKWebsiteDataStore::identifier not bound -!missing-selector! WKWebsiteDataStore::proxyConfigurations not bound -!missing-selector! WKWebsiteDataStore::setProxyConfigurations: not bound -!missing-selector! WKWebView::goBack: not bound -!missing-selector! WKWebView::goForward: not bound -!missing-selector! WKWebView::reload: not bound -!missing-selector! WKWebView::reloadFromOrigin: not bound -!missing-selector! WKWebView::stopLoading: not bound -!missing-selector! WKWebViewConfiguration::allowsInlinePredictions not bound -!missing-selector! WKWebViewConfiguration::setAllowsInlinePredictions: not bound -!missing-selector! WKWebViewConfiguration::setUserInterfaceDirectionPolicy: not bound -!missing-selector! WKWebViewConfiguration::userInterfaceDirectionPolicy not bound diff --git a/tests/xtro-sharpie/common-WebKit.ignore b/tests/xtro-sharpie/common-WebKit.ignore new file mode 100644 index 000000000000..b94857831eb0 --- /dev/null +++ b/tests/xtro-sharpie/common-WebKit.ignore @@ -0,0 +1,5 @@ +# xcode 15 +# requires OS_nw_proxy_config type which has not been bound yet, part of Xcode 15 Network binding +!missing-selector! WKWebsiteDataStore::proxyConfigurations not bound +!missing-selector! WKWebsiteDataStore::setProxyConfigurations: not bound + diff --git a/tests/xtro-sharpie/iOS-WebKit.todo b/tests/xtro-sharpie/iOS-WebKit.todo deleted file mode 100644 index 0352fb8aff1a..000000000000 --- a/tests/xtro-sharpie/iOS-WebKit.todo +++ /dev/null @@ -1,19 +0,0 @@ -!missing-enum! WKCookiePolicy not bound -!missing-enum! WKInactiveSchedulingPolicy not bound -!missing-field! WKWebsiteDataTypeHashSalt not bound -!missing-field! WKWebsiteDataTypeMediaKeys not bound -!missing-field! WKWebsiteDataTypeSearchFieldRecentSearches not bound -!missing-selector! +WKWebsiteDataStore::dataStoreForIdentifier: not bound -!missing-selector! +WKWebsiteDataStore::fetchAllDataStoreIdentifiers: not bound -!missing-selector! +WKWebsiteDataStore::removeDataStoreForIdentifier:completionHandler: not bound -!missing-selector! WKHTTPCookieStore::getCookiePolicy: not bound -!missing-selector! WKHTTPCookieStore::setCookiePolicy:completionHandler: not bound -!missing-selector! WKPDFConfiguration::allowTransparentBackground not bound -!missing-selector! WKPDFConfiguration::setAllowTransparentBackground: not bound -!missing-selector! WKPreferences::inactiveSchedulingPolicy not bound -!missing-selector! WKPreferences::setInactiveSchedulingPolicy: not bound -!missing-selector! WKWebsiteDataStore::identifier not bound -!missing-selector! WKWebsiteDataStore::proxyConfigurations not bound -!missing-selector! WKWebsiteDataStore::setProxyConfigurations: not bound -!missing-selector! WKWebViewConfiguration::allowsInlinePredictions not bound -!missing-selector! WKWebViewConfiguration::setAllowsInlinePredictions: not bound diff --git a/tests/xtro-sharpie/macOS-WebKit.ignore b/tests/xtro-sharpie/macOS-WebKit.ignore index 3b8dd101f280..515d41046b9e 100644 --- a/tests/xtro-sharpie/macOS-WebKit.ignore +++ b/tests/xtro-sharpie/macOS-WebKit.ignore @@ -2,3 +2,46 @@ # TODO WKWebView should conform to NSTextFinderClient is marked as macos(WK_MAC_TBA) as of 11.4 beta3 !unknown-native-enum! WKSelectionGranularity bound + +# xcode 15 +# API has been deprecated in macOS.. +!incorrect-protocol-member! WebOpenPanelResultListener::cancel is REQUIRED and should be abstract +!incorrect-protocol-member! WebOpenPanelResultListener::chooseFilename: is REQUIRED and should be abstract +!incorrect-protocol-member! WebOpenPanelResultListener::chooseFilenames: is REQUIRED and should be abstract +!incorrect-protocol-member! WebPolicyDecisionListener::download is REQUIRED and should be abstract +!incorrect-protocol-member! WebPolicyDecisionListener::ignore is REQUIRED and should be abstract +!incorrect-protocol-member! WebPolicyDecisionListener::use is REQUIRED and should be abstract + +# older/legacy API +!missing-selector! +NSObject::isKeyExcludedFromWebScript: not bound +!missing-selector! +NSObject::isSelectorExcludedFromWebScript: not bound +!missing-selector! +NSObject::webScriptNameForKey: not bound +!missing-selector! +NSObject::webScriptNameForSelector: not bound +!missing-selector! NSObject::finalizeForWebScript not bound +!missing-selector! NSObject::invokeDefaultMethodWithArguments: not bound +!missing-selector! NSObject::invokeUndefinedMethodFromWebScript:withArguments: not bound +!missing-selector! NSObject::objectForWebScript not bound +!missing-selector! NSObject::webFrame not bound +!missing-selector! NSObject::webPlugInContainerLoadRequest:inFrame: not bound +!missing-selector! NSObject::webPlugInContainerSelectionColor not bound +!missing-selector! NSObject::webPlugInContainerShowStatus: not bound +!missing-selector! NSObject::webPlugInDestroy not bound +!missing-selector! NSObject::webPlugInInitialize not bound +!missing-selector! NSObject::webPlugInMainResourceDidFailWithError: not bound +!missing-selector! NSObject::webPlugInMainResourceDidFinishLoading not bound +!missing-selector! NSObject::webPlugInMainResourceDidReceiveData: not bound +!missing-selector! NSObject::webPlugInMainResourceDidReceiveResponse: not bound +!missing-selector! NSObject::webPlugInSetIsSelected: not bound +!missing-selector! NSObject::webPlugInStart not bound +!missing-selector! NSObject::webPlugInStop not bound + +# is bound, not sure what xtro is on +!missing-selector! WKWebView::goBack: not bound +!missing-selector! WKWebView::goForward: not bound +!missing-selector! WKWebView::reload: not bound +!missing-selector! WKWebView::reloadFromOrigin: not bound +!missing-selector! WKWebView::stopLoading: not bound + +# enabled for XAMCORE 5, else breaking change +!missing-protocol-conformance! WKWebView should conform to NSTextFinderClient (defined in 'WKNSTextFinderClient' category) + diff --git a/tests/xtro-sharpie/macOS-WebKit.todo b/tests/xtro-sharpie/macOS-WebKit.todo deleted file mode 100644 index 87903f83fe3a..000000000000 --- a/tests/xtro-sharpie/macOS-WebKit.todo +++ /dev/null @@ -1,60 +0,0 @@ -!incorrect-protocol-member! WebOpenPanelResultListener::cancel is REQUIRED and should be abstract -!incorrect-protocol-member! WebOpenPanelResultListener::chooseFilename: is REQUIRED and should be abstract -!incorrect-protocol-member! WebOpenPanelResultListener::chooseFilenames: is REQUIRED and should be abstract -!incorrect-protocol-member! WebPolicyDecisionListener::download is REQUIRED and should be abstract -!incorrect-protocol-member! WebPolicyDecisionListener::ignore is REQUIRED and should be abstract -!incorrect-protocol-member! WebPolicyDecisionListener::use is REQUIRED and should be abstract -!missing-enum! WKCookiePolicy not bound -!missing-enum! WKInactiveSchedulingPolicy not bound -!missing-enum! WKUserInterfaceDirectionPolicy not bound -!missing-field! WebViewDidBeginEditingNotification not bound -!missing-field! WebViewDidChangeNotification not bound -!missing-field! WebViewDidChangeSelectionNotification not bound -!missing-field! WebViewDidChangeTypingStyleNotification not bound -!missing-field! WebViewDidEndEditingNotification not bound -!missing-field! WKWebsiteDataTypeHashSalt not bound -!missing-field! WKWebsiteDataTypeMediaKeys not bound -!missing-field! WKWebsiteDataTypeSearchFieldRecentSearches not bound -!missing-protocol-conformance! WKWebView should conform to NSTextFinderClient (defined in 'WKNSTextFinderClient' category) -!missing-selector! +NSObject::isKeyExcludedFromWebScript: not bound -!missing-selector! +NSObject::isSelectorExcludedFromWebScript: not bound -!missing-selector! +NSObject::webScriptNameForKey: not bound -!missing-selector! +NSObject::webScriptNameForSelector: not bound -!missing-selector! +WKWebsiteDataStore::dataStoreForIdentifier: not bound -!missing-selector! +WKWebsiteDataStore::fetchAllDataStoreIdentifiers: not bound -!missing-selector! +WKWebsiteDataStore::removeDataStoreForIdentifier:completionHandler: not bound -!missing-selector! NSObject::finalizeForWebScript not bound -!missing-selector! NSObject::invokeDefaultMethodWithArguments: not bound -!missing-selector! NSObject::invokeUndefinedMethodFromWebScript:withArguments: not bound -!missing-selector! NSObject::objectForWebScript not bound -!missing-selector! NSObject::webFrame not bound -!missing-selector! NSObject::webPlugInContainerLoadRequest:inFrame: not bound -!missing-selector! NSObject::webPlugInContainerSelectionColor not bound -!missing-selector! NSObject::webPlugInContainerShowStatus: not bound -!missing-selector! NSObject::webPlugInDestroy not bound -!missing-selector! NSObject::webPlugInInitialize not bound -!missing-selector! NSObject::webPlugInMainResourceDidFailWithError: not bound -!missing-selector! NSObject::webPlugInMainResourceDidFinishLoading not bound -!missing-selector! NSObject::webPlugInMainResourceDidReceiveData: not bound -!missing-selector! NSObject::webPlugInMainResourceDidReceiveResponse: not bound -!missing-selector! NSObject::webPlugInSetIsSelected: not bound -!missing-selector! NSObject::webPlugInStart not bound -!missing-selector! NSObject::webPlugInStop not bound -!missing-selector! WKHTTPCookieStore::getCookiePolicy: not bound -!missing-selector! WKHTTPCookieStore::setCookiePolicy:completionHandler: not bound -!missing-selector! WKPDFConfiguration::allowTransparentBackground not bound -!missing-selector! WKPDFConfiguration::setAllowTransparentBackground: not bound -!missing-selector! WKPreferences::inactiveSchedulingPolicy not bound -!missing-selector! WKPreferences::setInactiveSchedulingPolicy: not bound -!missing-selector! WKWebsiteDataStore::identifier not bound -!missing-selector! WKWebsiteDataStore::proxyConfigurations not bound -!missing-selector! WKWebsiteDataStore::setProxyConfigurations: not bound -!missing-selector! WKWebView::goBack: not bound -!missing-selector! WKWebView::goForward: not bound -!missing-selector! WKWebView::reload: not bound -!missing-selector! WKWebView::reloadFromOrigin: not bound -!missing-selector! WKWebView::stopLoading: not bound -!missing-selector! WKWebViewConfiguration::allowsInlinePredictions not bound -!missing-selector! WKWebViewConfiguration::setAllowsInlinePredictions: not bound -!missing-selector! WKWebViewConfiguration::setUserInterfaceDirectionPolicy: not bound -!missing-selector! WKWebViewConfiguration::userInterfaceDirectionPolicy not bound From e182f53e4e998a2013d7463c84183ef8f4748b6d Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Tue, 17 Oct 2023 16:33:34 +0000 Subject: [PATCH 2/5] Auto-format source code --- src/webkit.cs | 92 ++++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/src/webkit.cs b/src/webkit.cs index 3559c131e386..852db16ec8bc 100644 --- a/src/webkit.cs +++ b/src/webkit.cs @@ -4380,27 +4380,24 @@ public enum WKDialogResult : long { Handled, } - [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] [Native] - public enum WKCookiePolicy : long - { + public enum WKCookiePolicy : long { Allow, Disallow, } - [iOS(17,0), Mac(14, 0), MacCatalyst(17,0)] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] [Native] - public enum WKInactiveSchedulingPolicy : long - { + public enum WKInactiveSchedulingPolicy : long { Suspend, Throttle, None, } - [NoiOS, Mac(14, 0), NoMacCatalyst] + [NoiOS, Mac (14, 0), NoMacCatalyst] [Native] - public enum WKUserInterfaceDirectionPolicy : long - { + public enum WKUserInterfaceDirectionPolicy : long { Content, System, } @@ -4506,15 +4503,15 @@ interface WKHttpCookieStore { [Export ("removeObserver:")] void RemoveObserver (IWKHttpCookieStoreObserver observer); - [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] - [Export("setCookiePolicy:completionHandler:")] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] + [Export ("setCookiePolicy:completionHandler:")] [Async] - void SetCookiePolicy(WKCookiePolicy policy, [NullAllowed] Action completionHandler); + void SetCookiePolicy (WKCookiePolicy policy, [NullAllowed] Action completionHandler); - [iOS(17,0), Mac(14, 0), MacCatalyst(17,0)] - [Export("getCookiePolicy:")] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] + [Export ("getCookiePolicy:")] [Async] - void GetCookiePolicy(Action completionHandler); + void GetCookiePolicy (Action completionHandler); } interface IWKHttpCookieStoreObserver { } @@ -4727,8 +4724,8 @@ interface WKPreferences : NSSecureCoding { [Export ("elementFullscreenEnabled")] bool ElementFullscreenEnabled { [Bind ("isElementFullscreenEnabled")] get; set; } - [Mac(14, 0), iOS(17,0), MacCatalyst(17,0)] - [Export("inactiveSchedulingPolicy", ArgumentSemantic.Assign)] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("inactiveSchedulingPolicy", ArgumentSemantic.Assign)] WKInactiveSchedulingPolicy InactiveSchedulingPolicy { get; set; } } @@ -4891,36 +4888,35 @@ interface WKWebsiteDataType { [Field ("WKWebsiteDataTypeFileSystem")] NSString FileSystem { get; } - [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] - [Field("WKWebsiteDataTypeSearchFieldRecentSearches")] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] + [Field ("WKWebsiteDataTypeSearchFieldRecentSearches")] NSString SearchFieldRecentSearches { get; } - [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] - [Field("WKWebsiteDataTypeMediaKeys")] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] + [Field ("WKWebsiteDataTypeMediaKeys")] NSString MediaKeys { get; } - [iOS (17,0), Mac(14, 0), MacCatalyst(17, 0)] - [Field("WKWebsiteDataTypeHashSalt")] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] + [Field ("WKWebsiteDataTypeHashSalt")] NSString HashSalt { get; } } - [NoiOS, NoMacCatalyst, Mac (14,0)] + [NoiOS, NoMacCatalyst, Mac (14, 0)] [Static] - interface WebViewNotification - { - [Field("WebViewDidBeginEditingNotification")] + interface WebViewNotification { + [Field ("WebViewDidBeginEditingNotification")] NSString DidBeginEditing { get; } - [Field("WebViewDidChangeNotification")] + [Field ("WebViewDidChangeNotification")] NSString DidChange { get; } - [Field("WebViewDidEndEditingNotification")] + [Field ("WebViewDidEndEditingNotification")] NSString DidEndEditing { get; } - [Field("WebViewDidChangeTypingStyleNotification")] + [Field ("WebViewDidChangeTypingStyleNotification")] NSString DidChangeTypingStyle { get; } - [Field("WebViewDidChangeSelectionNotification")] + [Field ("WebViewDidChangeSelectionNotification")] NSString DidChangeSelection { get; } } @@ -4960,26 +4956,26 @@ interface WKWebsiteDataStore : NSSecureCoding { [Export ("httpCookieStore")] WKHttpCookieStore HttpCookieStore { get; } - [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] - [NullAllowed, Export("identifier")] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] + [NullAllowed, Export ("identifier")] NSUuid Identifier { get; } - [iOS(17,0), Mac(14, 0), MacCatalyst(17, 0)] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] [Static] - [Export("dataStoreForIdentifier:")] - WKWebsiteDataStore Create(NSUuid identifier); + [Export ("dataStoreForIdentifier:")] + WKWebsiteDataStore Create (NSUuid identifier); - [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] [Static] [Async] - [Export("removeDataStoreForIdentifier:completionHandler:")] - void Remove(NSUuid identifier, Action completionHandler); + [Export ("removeDataStoreForIdentifier:completionHandler:")] + void Remove (NSUuid identifier, Action completionHandler); - [iOS(17, 0), Mac(14, 0), MacCatalyst(17, 0)] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] [Static] [Async] - [Export("fetchAllDataStoreIdentifiers:")] - void FetchAllDataStoreIdentifiers(Action> completionHandler); + [Export ("fetchAllDataStoreIdentifiers:")] + void FetchAllDataStoreIdentifiers (Action> completionHandler); } [NoiOS, NoWatch, NoTV] @@ -5644,12 +5640,12 @@ interface WKWebViewConfiguration : NSCopying, NSSecureCoding { [Export ("upgradeKnownHostsToHTTPS")] bool UpgradeKnownHostsToHttps { get; set; } - [Mac(14, 0), iOS(17, 0), MacCatalyst(17,0)] - [Export("allowsInlinePredictions")] + [Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("allowsInlinePredictions")] bool AllowsInlinePredictions { get; set; } - [NoiOS, Mac(14, 0)] - [Export("userInterfaceDirectionPolicy", ArgumentSemantic.Assign)] + [NoiOS, Mac (14, 0)] + [Export ("userInterfaceDirectionPolicy", ArgumentSemantic.Assign)] WKUserInterfaceDirectionPolicy UserInterfaceDirectionPolicy { get; set; } } @@ -5841,8 +5837,8 @@ interface WKPdfConfiguration : NSCopying { [Export ("rect", ArgumentSemantic.Assign)] CGRect Rect { get; set; } - [iOS(17,0), Mac(14, 0), MacCatalyst(17,0)] - [Export("allowTransparentBackground")] + [iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)] + [Export ("allowTransparentBackground")] bool AllowTransparentBackground { get; set; } } From 7977a457bd6077e437df577c58a789c2d648b32c Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Tue, 17 Oct 2023 17:58:42 -0700 Subject: [PATCH 3/5] fix cecil test failure --- src/webkit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webkit.cs b/src/webkit.cs index 852db16ec8bc..3da816214b79 100644 --- a/src/webkit.cs +++ b/src/webkit.cs @@ -5644,7 +5644,7 @@ interface WKWebViewConfiguration : NSCopying, NSSecureCoding { [Export ("allowsInlinePredictions")] bool AllowsInlinePredictions { get; set; } - [NoiOS, Mac (14, 0)] + [NoiOS, Mac (14, 0), NoMacCatalyst] [Export ("userInterfaceDirectionPolicy", ArgumentSemantic.Assign)] WKUserInterfaceDirectionPolicy UserInterfaceDirectionPolicy { get; set; } } From 333702718cb58a92baf685237736b0fc666a7ac4 Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Wed, 18 Oct 2023 11:36:06 -0700 Subject: [PATCH 4/5] add WKWebView bindings --- src/webkit.cs | 20 +++++++++++++++++++ .../macOS-WebKit.ignore | 7 ------- tests/xtro-sharpie/macOS-WebKit.ignore | 7 ------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/webkit.cs b/src/webkit.cs index 3da816214b79..78627cb1f410 100644 --- a/src/webkit.cs +++ b/src/webkit.cs @@ -5532,6 +5532,26 @@ interface WKWebView [Mac (13, 3), MacCatalyst (16, 4), iOS (16, 4), NoWatch, NoTV] [Export ("inspectable")] bool Inspectable { [Bind ("isInspectable")] get; set; } + + [NoiOS, NoMacCatalyst, Mac(14,0)] + [Export("goBack:")] + void GoBack([NullAllowed] NSObject sender); + + [NoiOS, NoMacCatalyst, Mac(14,0)] + [Export("goForward:")] + void GoForward([NullAllowed] NSObject sender); + + [NoiOS, NoMacCatalyst, Mac(14,0)] + [Export("reload:")] + void Reload([NullAllowed] NSObject sender); + + [NoiOS, NoMacCatalyst, Mac(14,0)] + [Export("reloadFromOrigin:")] + void ReloadFromOrigin([NullAllowed] NSObject sender); + + [NoiOS, NoMacCatalyst, Mac(14,0)] + [Export("stopLoading:")] + void StopLoading([NullAllowed] NSObject sender); } delegate void WKJavascriptEvaluationResult (NSObject result, NSError error); diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.ignore index e6d77fe31e08..ef6bf8942c75 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.ignore @@ -27,13 +27,6 @@ !missing-selector! NSObject::webPlugInStart not bound !missing-selector! NSObject::webPlugInStop not bound -# is bound, not sure what xtro is on -!missing-selector! WKWebView::goBack: not bound -!missing-selector! WKWebView::goForward: not bound -!missing-selector! WKWebView::reload: not bound -!missing-selector! WKWebView::reloadFromOrigin: not bound -!missing-selector! WKWebView::stopLoading: not bound - # enabled for XAMCORE 5, else breaking change !missing-protocol-conformance! WKWebView should conform to NSTextFinderClient (defined in 'WKNSTextFinderClient' category) diff --git a/tests/xtro-sharpie/macOS-WebKit.ignore b/tests/xtro-sharpie/macOS-WebKit.ignore index 515d41046b9e..e590824ac224 100644 --- a/tests/xtro-sharpie/macOS-WebKit.ignore +++ b/tests/xtro-sharpie/macOS-WebKit.ignore @@ -35,13 +35,6 @@ !missing-selector! NSObject::webPlugInStart not bound !missing-selector! NSObject::webPlugInStop not bound -# is bound, not sure what xtro is on -!missing-selector! WKWebView::goBack: not bound -!missing-selector! WKWebView::goForward: not bound -!missing-selector! WKWebView::reload: not bound -!missing-selector! WKWebView::reloadFromOrigin: not bound -!missing-selector! WKWebView::stopLoading: not bound - # enabled for XAMCORE 5, else breaking change !missing-protocol-conformance! WKWebView should conform to NSTextFinderClient (defined in 'WKNSTextFinderClient' category) From 3c7425e62459a660e2d642a4293db41dbd8098ce Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Wed, 18 Oct 2023 18:44:22 +0000 Subject: [PATCH 5/5] Auto-format source code --- src/webkit.cs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/webkit.cs b/src/webkit.cs index 78627cb1f410..8d21cfc09614 100644 --- a/src/webkit.cs +++ b/src/webkit.cs @@ -5533,25 +5533,25 @@ interface WKWebView [Export ("inspectable")] bool Inspectable { [Bind ("isInspectable")] get; set; } - [NoiOS, NoMacCatalyst, Mac(14,0)] - [Export("goBack:")] - void GoBack([NullAllowed] NSObject sender); + [NoiOS, NoMacCatalyst, Mac (14, 0)] + [Export ("goBack:")] + void GoBack ([NullAllowed] NSObject sender); - [NoiOS, NoMacCatalyst, Mac(14,0)] - [Export("goForward:")] - void GoForward([NullAllowed] NSObject sender); + [NoiOS, NoMacCatalyst, Mac (14, 0)] + [Export ("goForward:")] + void GoForward ([NullAllowed] NSObject sender); - [NoiOS, NoMacCatalyst, Mac(14,0)] - [Export("reload:")] - void Reload([NullAllowed] NSObject sender); + [NoiOS, NoMacCatalyst, Mac (14, 0)] + [Export ("reload:")] + void Reload ([NullAllowed] NSObject sender); - [NoiOS, NoMacCatalyst, Mac(14,0)] - [Export("reloadFromOrigin:")] - void ReloadFromOrigin([NullAllowed] NSObject sender); + [NoiOS, NoMacCatalyst, Mac (14, 0)] + [Export ("reloadFromOrigin:")] + void ReloadFromOrigin ([NullAllowed] NSObject sender); - [NoiOS, NoMacCatalyst, Mac(14,0)] - [Export("stopLoading:")] - void StopLoading([NullAllowed] NSObject sender); + [NoiOS, NoMacCatalyst, Mac (14, 0)] + [Export ("stopLoading:")] + void StopLoading ([NullAllowed] NSObject sender); } delegate void WKJavascriptEvaluationResult (NSObject result, NSError error);