Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebKit] Add support for Xcode 15 #19237

Merged
merged 5 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 123 additions & 1 deletion src/webkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4380,6 +4380,28 @@ 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.
Expand Down Expand Up @@ -4480,6 +4502,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<WKCookiePolicy> completionHandler);
}

interface IWKHttpCookieStoreObserver { }
Expand Down Expand Up @@ -4691,6 +4723,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)]
Expand Down Expand Up @@ -4851,6 +4887,37 @@ 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)]
Expand Down Expand Up @@ -4888,6 +4955,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<NSError> completionHandler);

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Static]
[Async]
[Export ("fetchAllDataStoreIdentifiers:")]
void FetchAllDataStoreIdentifiers (Action<NSArray<NSUuid>> completionHandler);
}

[NoiOS, NoWatch, NoTV]
Expand Down Expand Up @@ -5093,7 +5181,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
{

Expand Down Expand Up @@ -5442,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);
Expand Down Expand Up @@ -5549,6 +5659,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), NoMacCatalyst]
[Export ("userInterfaceDirectionPolicy", ArgumentSemantic.Assign)]
WKUserInterfaceDirectionPolicy UserInterfaceDirectionPolicy { get; set; }
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -5738,6 +5856,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 { }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Comment on lines +1 to +4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haritha-mohan can you please create an issue to track this, I'll take care of it once I do the network framework.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 #19259


19 changes: 0 additions & 19 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-WebKit.todo

This file was deleted.

29 changes: 29 additions & 0 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.ignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
## 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

# enabled for XAMCORE 5, else breaking change
!missing-protocol-conformance! WKWebView should conform to NSTextFinderClient (defined in 'WKNSTextFinderClient' category)

54 changes: 0 additions & 54 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.todo

This file was deleted.

5 changes: 5 additions & 0 deletions tests/xtro-sharpie/common-WebKit.ignore
Original file line number Diff line number Diff line change
@@ -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

19 changes: 0 additions & 19 deletions tests/xtro-sharpie/iOS-WebKit.todo

This file was deleted.

36 changes: 36 additions & 0 deletions tests/xtro-sharpie/macOS-WebKit.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,39 @@

# 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
haritha-mohan marked this conversation as resolved.
Show resolved Hide resolved

# older/legacy API
!missing-selector! +NSObject::isKeyExcludedFromWebScript: not bound
haritha-mohan marked this conversation as resolved.
Show resolved Hide resolved
!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

# enabled for XAMCORE 5, else breaking change
!missing-protocol-conformance! WKWebView should conform to NSTextFinderClient (defined in 'WKNSTextFinderClient' category)

Loading