From 1e2dab87fa3d89140e5eda73f056aa2eb3612c51 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 2 Dec 2024 10:17:26 +0100 Subject: [PATCH 1/2] [WebKit] Implement Xcode 16.2 beta 1-3 changes. --- src/webkit.cs | 51 +++++++++++++++++-- .../Documentation.KnownFailures.txt | 20 ++++++++ .../MacCatalyst-WebKit.todo | 9 ---- .../api-annotations-dotnet/iOS-WebKit.todo | 14 ----- .../api-annotations-dotnet/macOS-WebKit.todo | 9 ---- 5 files changed, 68 insertions(+), 35 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-WebKit.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-WebKit.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.todo diff --git a/src/webkit.cs b/src/webkit.cs index a48951edf953..23c660520161 100644 --- a/src/webkit.cs +++ b/src/webkit.cs @@ -5563,7 +5563,7 @@ interface WKWebView [Export ("stopLoading:")] void StopLoading ([NullAllowed] NSObject sender); - [Mac (15, 0), NoiOS, MacCatalyst (18, 0)] + [Mac (15, 0), iOS (18, 2), MacCatalyst (18, 0)] [Export ("writingToolsActive")] bool WritingToolsActive { [Bind ("isWritingToolsActive")] get; } } @@ -5690,11 +5690,11 @@ interface WKWebViewConfiguration : NSCopying, NSSecureCoding { [Export ("userInterfaceDirectionPolicy", ArgumentSemantic.Assign)] WKUserInterfaceDirectionPolicy UserInterfaceDirectionPolicy { get; set; } - [Mac (15, 0), NoiOS, MacCatalyst (18, 0)] + [Mac (15, 0), iOS (18, 2), MacCatalyst (18, 0)] [Export ("supportsAdaptiveImageGlyph")] bool SupportsAdaptiveImageGlyph { get; set; } - [Mac (15, 0), NoiOS, MacCatalyst (18, 0)] + [Mac (15, 0), iOS (18, 2), MacCatalyst (18, 0)] [Export ("writingToolsBehavior")] #if MONOMAC NSWritingToolsBehavior WritingToolsBehavior { get; set; } @@ -5830,6 +5830,10 @@ interface WKWebpagePreferences { [Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV] [Export ("lockdownModeEnabled")] bool LockdownModeEnabled { [Bind ("isLockdownModeEnabled")] get; set; } + + [Mac (15, 2), iOS (18, 2), MacCatalyst (18, 2)] + [Export ("preferredHTTPSNavigationPolicy", ArgumentSemantic.Assign)] + WKWebpagePreferencesUpgradeToHttpsPolicy PreferredHttpsNavigationPolicy { get; set; } } [NoMac] @@ -5934,6 +5938,8 @@ enum WKMediaPlaybackState : ulong { interface IWKDownloadDelegate { } + delegate void WKDownloadDelegateDecidePlaceholderPolicyCallback (WKDownloadPlaceholderPolicy policy, [NullAllowed] NSUrl url); + [iOS (14, 5)] [MacCatalyst (14, 5)] #if NET @@ -5959,6 +5965,18 @@ interface WKDownloadDelegate { [Export ("download:didFailWithError:resumeData:")] void DidFail (WKDownload download, NSError error, [NullAllowed] NSData resumeData); + + [iOS (18, 2), MacCatalyst (18, 2), Mac (15, 2)] + [Export ("download:decidePlaceholderPolicy:")] + void DecidePlaceholderPolicy (WKDownload download, WKDownloadDelegateDecidePlaceholderPolicyCallback completionHandler); + + [iOS (18, 2), MacCatalyst (18, 2), Mac (15, 2)] + [Export ("download:didReceivePlaceholderURL:completionHandler:")] + void DidReceivePlaceholderUrl (WKDownload download, NSUrl url, Action completionHandler); + + [iOS (18, 2), MacCatalyst (18, 2), Mac (15, 2)] + [Export ("download:didReceiveFinalURL:")] + void DidReceiveFinalUrl (WKDownload download, NSUrl url); } [iOS (14, 5)] @@ -5983,5 +6001,32 @@ interface WKDownload : NSProgressReporting { [Async] [Export ("cancel:")] void Cancel ([NullAllowed] Action completionHandler); + + [Mac (15, 2), iOS (18, 2), MacCatalyst (18, 2)] + [Export ("userInitiated")] + bool UserInitiated { [Bind ("isUserInitiated")] get; } + + [Mac (15, 2), iOS (18, 2), MacCatalyst (18, 2)] + [Export ("originatingFrame")] + WKFrameInfo OriginatingFrame { get; } + + } + + [iOS (18, 2), MacCatalyst (18, 2), Mac (15, 2)] + [Native] + public enum WKDownloadPlaceholderPolicy : long + { + Disable, + Enable, + } + + [Mac (15, 2), iOS (18,2), MacCatalyst (18, 2)] + [Native ("WKWebpagePreferencesUpgradeToHTTPSPolicy")] + public enum WKWebpagePreferencesUpgradeToHttpsPolicy : long + { + KeepAsRequested, + AutomaticFallbackToHttp, + UserMediatedFallbackToHttp, + ErrorOnFailure, } } diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index 5c3414a6c973..af91a8e79a8c 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -21800,6 +21800,8 @@ F:WebKit.WKDataDetectorTypes.TrackingNumber F:WebKit.WKDialogResult.AskAgain F:WebKit.WKDialogResult.Handled F:WebKit.WKDialogResult.ShowDefault +F:WebKit.WKDownloadPlaceholderPolicy.Disable +F:WebKit.WKDownloadPlaceholderPolicy.Enable F:WebKit.WKDownloadRedirectPolicy.Allow F:WebKit.WKDownloadRedirectPolicy.Cancel F:WebKit.WKErrorCode.AttributedStringContentFailedToLoad @@ -21858,6 +21860,10 @@ F:WebKit.WKUserInterfaceDirectionPolicy.Content F:WebKit.WKUserInterfaceDirectionPolicy.System F:WebKit.WKUserScriptInjectionTime.AtDocumentEnd F:WebKit.WKUserScriptInjectionTime.AtDocumentStart +F:WebKit.WKWebpagePreferencesUpgradeToHttpsPolicy.AutomaticFallbackToHttp +F:WebKit.WKWebpagePreferencesUpgradeToHttpsPolicy.ErrorOnFailure +F:WebKit.WKWebpagePreferencesUpgradeToHttpsPolicy.KeepAsRequested +F:WebKit.WKWebpagePreferencesUpgradeToHttpsPolicy.UserMediatedFallbackToHttp M:Accelerate.vImage.BoxConvolveARGB8888(Accelerate.vImageBuffer@,Accelerate.vImageBuffer@,System.IntPtr,System.IntPtr,System.IntPtr,System.UInt32,System.UInt32,Accelerate.Pixel8888,Accelerate.vImageFlags) M:Accelerate.vImage.BoxConvolveARGB8888(Accelerate.vImageBuffer@,Accelerate.vImageBuffer@,System.IntPtr,System.IntPtr,System.IntPtr,System.UInt32,System.UInt32,Accelerate.Pixel8888*,Accelerate.vImageFlags) M:Accelerate.vImage.BoxConvolvePlanar8(Accelerate.vImageBuffer@,Accelerate.vImageBuffer@,System.IntPtr,System.IntPtr,System.IntPtr,System.UInt32,System.UInt32,System.Byte,Accelerate.vImageFlags) @@ -47757,9 +47763,12 @@ M:WebKit.IWebUIDelegate.UIValidateUserInterfaceItem(WebKit.WebView,Foundation.NS M:WebKit.IWebUIDelegate.UIWillPerformDragDestination(WebKit.WebView,WebKit.WebDragDestinationAction,AppKit.INSDraggingInfo) M:WebKit.IWebUIDelegate.UIWillPerformDragSource(WebKit.WebView,WebKit.WebDragSourceAction,CoreGraphics.CGPoint,AppKit.NSPasteboard) M:WebKit.IWKDownloadDelegate.DecideDestination(WebKit.WKDownload,Foundation.NSUrlResponse,System.String,System.Action{Foundation.NSUrl}) +M:WebKit.IWKDownloadDelegate.DecidePlaceholderPolicy(WebKit.WKDownload,WebKit.WKDownloadDelegateDecidePlaceholderPolicyCallback) M:WebKit.IWKDownloadDelegate.DidFail(WebKit.WKDownload,Foundation.NSError,Foundation.NSData) M:WebKit.IWKDownloadDelegate.DidFinish(WebKit.WKDownload) M:WebKit.IWKDownloadDelegate.DidReceiveAuthenticationChallenge(WebKit.WKDownload,Foundation.NSUrlAuthenticationChallenge,System.Action{Foundation.NSUrlSessionAuthChallengeDisposition,Foundation.NSUrlCredential}) +M:WebKit.IWKDownloadDelegate.DidReceiveFinalUrl(WebKit.WKDownload,Foundation.NSUrl) +M:WebKit.IWKDownloadDelegate.DidReceivePlaceholderUrl(WebKit.WKDownload,Foundation.NSUrl,System.Action) M:WebKit.IWKDownloadDelegate.WillPerformHttpRedirection(WebKit.WKDownload,Foundation.NSHttpUrlResponse,Foundation.NSUrlRequest,System.Action{WebKit.WKDownloadRedirectPolicy}) M:WebKit.IWKHttpCookieStoreObserver.CookiesDidChangeInCookieStore(WebKit.WKHttpCookieStore) M:WebKit.IWKNavigationDelegate.ContentProcessDidTerminate(WebKit.WKWebView) @@ -48028,10 +48037,16 @@ M:WebKit.WKContentRuleListStore.LookUpContentRuleListAsync(System.String) M:WebKit.WKContentRuleListStore.RemoveContentRuleListAsync(System.String) M:WebKit.WKDownload.CancelAsync M:WebKit.WKDownload.Dispose(System.Boolean) +M:WebKit.WKDownloadDelegate_Extensions.DecidePlaceholderPolicy(WebKit.IWKDownloadDelegate,WebKit.WKDownload,WebKit.WKDownloadDelegateDecidePlaceholderPolicyCallback) M:WebKit.WKDownloadDelegate_Extensions.DidFail(WebKit.IWKDownloadDelegate,WebKit.WKDownload,Foundation.NSError,Foundation.NSData) M:WebKit.WKDownloadDelegate_Extensions.DidFinish(WebKit.IWKDownloadDelegate,WebKit.WKDownload) M:WebKit.WKDownloadDelegate_Extensions.DidReceiveAuthenticationChallenge(WebKit.IWKDownloadDelegate,WebKit.WKDownload,Foundation.NSUrlAuthenticationChallenge,System.Action{Foundation.NSUrlSessionAuthChallengeDisposition,Foundation.NSUrlCredential}) +M:WebKit.WKDownloadDelegate_Extensions.DidReceiveFinalUrl(WebKit.IWKDownloadDelegate,WebKit.WKDownload,Foundation.NSUrl) +M:WebKit.WKDownloadDelegate_Extensions.DidReceivePlaceholderUrl(WebKit.IWKDownloadDelegate,WebKit.WKDownload,Foundation.NSUrl,System.Action) M:WebKit.WKDownloadDelegate_Extensions.WillPerformHttpRedirection(WebKit.IWKDownloadDelegate,WebKit.WKDownload,Foundation.NSHttpUrlResponse,Foundation.NSUrlRequest,System.Action{WebKit.WKDownloadRedirectPolicy}) +M:WebKit.WKDownloadDelegate.DecidePlaceholderPolicy(WebKit.WKDownload,WebKit.WKDownloadDelegateDecidePlaceholderPolicyCallback) +M:WebKit.WKDownloadDelegate.DidReceiveFinalUrl(WebKit.WKDownload,Foundation.NSUrl) +M:WebKit.WKDownloadDelegate.DidReceivePlaceholderUrl(WebKit.WKDownload,Foundation.NSUrl,System.Action) M:WebKit.WKFindConfiguration.Copy(Foundation.NSZone) M:WebKit.WKFindResult.Copy(Foundation.NSZone) M:WebKit.WKFrameInfo.Copy(Foundation.NSZone) @@ -69757,6 +69772,7 @@ P:WebKit.WebViewStatusTextEventArgs.Text P:WebKit.WebViewToolBarsEventArgs.Visible P:WebKit.WKDownload.Delegate P:WebKit.WKDownload.Progress +P:WebKit.WKDownload.UserInitiated P:WebKit.WKFrameInfo.MainFrame P:WebKit.WKNavigationResponse.IsForMainFrame P:WebKit.WKPreferences.ElementFullscreenEnabled @@ -69769,6 +69785,7 @@ P:WebKit.WKPreviewActionItemIdentifier.Open P:WebKit.WKPreviewActionItemIdentifier.Share P:WebKit.WKUserScript.IsForMainFrameOnly P:WebKit.WKWebpagePreferences.LockdownModeEnabled +P:WebKit.WKWebpagePreferences.PreferredHttpsNavigationPolicy P:WebKit.WKWebsiteDataStore.Persistent P:WebKit.WKWebsiteDataType.Cookies P:WebKit.WKWebsiteDataType.DiskCache @@ -76682,6 +76699,8 @@ T:WebKit.WKContentMode T:WebKit.WKCookiePolicy T:WebKit.WKDialogResult T:WebKit.WKDownloadDelegate +T:WebKit.WKDownloadDelegateDecidePlaceholderPolicyCallback +T:WebKit.WKDownloadPlaceholderPolicy T:WebKit.WKDownloadRedirectPolicy T:WebKit.WKFullscreenState T:WebKit.WKInactiveSchedulingPolicy @@ -76690,3 +76709,4 @@ T:WebKit.WKMediaCaptureType T:WebKit.WKMediaPlaybackState T:WebKit.WKPermissionDecision T:WebKit.WKUserInterfaceDirectionPolicy +T:WebKit.WKWebpagePreferencesUpgradeToHttpsPolicy 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 cf4b387a3c88..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-WebKit.todo +++ /dev/null @@ -1,9 +0,0 @@ -!missing-selector! WKDownload::isUserInitiated not bound -!missing-selector! WKDownload::originatingFrame not bound -!missing-enum! WKDownloadPlaceholderPolicy not bound -!missing-enum! WKWebpagePreferencesUpgradeToHTTPSPolicy not bound -!missing-protocol-member! WKDownloadDelegate::download:decidePlaceholderPolicy: not found -!missing-protocol-member! WKDownloadDelegate::download:didReceiveFinalURL: not found -!missing-protocol-member! WKDownloadDelegate::download:didReceivePlaceholderURL:completionHandler: not found -!missing-selector! WKWebpagePreferences::preferredHTTPSNavigationPolicy not bound -!missing-selector! WKWebpagePreferences::setPreferredHTTPSNavigationPolicy: 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 e11f9b395ea0..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-WebKit.todo +++ /dev/null @@ -1,14 +0,0 @@ -!missing-selector! WKWebView::isWritingToolsActive not bound -!missing-selector! WKWebViewConfiguration::setSupportsAdaptiveImageGlyph: not bound -!missing-selector! WKWebViewConfiguration::setWritingToolsBehavior: not bound -!missing-selector! WKWebViewConfiguration::supportsAdaptiveImageGlyph not bound -!missing-selector! WKWebViewConfiguration::writingToolsBehavior not bound -!missing-selector! WKDownload::isUserInitiated not bound -!missing-selector! WKDownload::originatingFrame not bound -!missing-enum! WKDownloadPlaceholderPolicy not bound -!missing-enum! WKWebpagePreferencesUpgradeToHTTPSPolicy not bound -!missing-protocol-member! WKDownloadDelegate::download:decidePlaceholderPolicy: not found -!missing-protocol-member! WKDownloadDelegate::download:didReceiveFinalURL: not found -!missing-protocol-member! WKDownloadDelegate::download:didReceivePlaceholderURL:completionHandler: not found -!missing-selector! WKWebpagePreferences::preferredHTTPSNavigationPolicy not bound -!missing-selector! WKWebpagePreferences::setPreferredHTTPSNavigationPolicy: not bound 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 cf4b387a3c88..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.todo +++ /dev/null @@ -1,9 +0,0 @@ -!missing-selector! WKDownload::isUserInitiated not bound -!missing-selector! WKDownload::originatingFrame not bound -!missing-enum! WKDownloadPlaceholderPolicy not bound -!missing-enum! WKWebpagePreferencesUpgradeToHTTPSPolicy not bound -!missing-protocol-member! WKDownloadDelegate::download:decidePlaceholderPolicy: not found -!missing-protocol-member! WKDownloadDelegate::download:didReceiveFinalURL: not found -!missing-protocol-member! WKDownloadDelegate::download:didReceivePlaceholderURL:completionHandler: not found -!missing-selector! WKWebpagePreferences::preferredHTTPSNavigationPolicy not bound -!missing-selector! WKWebpagePreferences::setPreferredHTTPSNavigationPolicy: not bound From 92eea1bb47d58963384ec31ed325d676b1520f30 Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Mon, 2 Dec 2024 11:17:29 +0000 Subject: [PATCH 2/2] Auto-format source code --- src/webkit.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/webkit.cs b/src/webkit.cs index 23c660520161..fdcce5953a29 100644 --- a/src/webkit.cs +++ b/src/webkit.cs @@ -6014,16 +6014,14 @@ interface WKDownload : NSProgressReporting { [iOS (18, 2), MacCatalyst (18, 2), Mac (15, 2)] [Native] - public enum WKDownloadPlaceholderPolicy : long - { + public enum WKDownloadPlaceholderPolicy : long { Disable, Enable, } - [Mac (15, 2), iOS (18,2), MacCatalyst (18, 2)] + [Mac (15, 2), iOS (18, 2), MacCatalyst (18, 2)] [Native ("WKWebpagePreferencesUpgradeToHTTPSPolicy")] - public enum WKWebpagePreferencesUpgradeToHttpsPolicy : long - { + public enum WKWebpagePreferencesUpgradeToHttpsPolicy : long { KeepAsRequested, AutomaticFallbackToHttp, UserMediatedFallbackToHttp,