Skip to content

Commit

Permalink
[WebKit] Fix nullability in WKUIDelegate.RunJavaScriptTextInputPanel …
Browse files Browse the repository at this point in the history
…for XAMCORE_5_0. (#22199)

Ref: #15728.
  • Loading branch information
rolfbjarne authored Feb 27, 2025
1 parent c6b5bfa commit dfb9a22
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/webkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4994,6 +4994,10 @@ interface WKOpenPanelParameters {
bool AllowsDirectories { get; }
}

#if XAMCORE_5_0
delegate void WKUIDelegateRunJavaScriptTextInputPanelCallback ([NullAllowed] string result);
#endif

/// <summary>A delegate object that allows presenting native UI elements on behalf of a Web page.</summary>
///
/// <related type="externalDocumentation" href="https://developer.apple.com/library/ios/documentation/WebKit/Reference/WKUIDelegate_Ref/index.html">Apple documentation for <c>WKUIDelegate</c></related>
Expand All @@ -5013,9 +5017,17 @@ WKWebView CreateWebView (WKWebView webView, WKWebViewConfiguration configuration
[Export ("webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:")]
void RunJavaScriptConfirmPanel (WKWebView webView, string message, WKFrameInfo frame, Action<bool> completionHandler);

#if !XAMCORE_5_0
[Obsolete ("It's not possible to call the completion handler with a null value using this method. Please see https://github.com/xamarin/xamarin-macios/issues/15728 for a workaround.")]
[Export ("webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:")]
void RunJavaScriptTextInputPanel (WKWebView webView, string prompt, [NullAllowed] string defaultText,
WKFrameInfo frame, Action<string> completionHandler);
#endif

#if XAMCORE_5_0
[Export ("webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:")]
void RunJavaScriptTextInputPanel (WKWebView webView, string prompt, [NullAllowed] string defaultText, WKFrameInfo frame, WKUIDelegateRunJavaScriptTextInputPanelCallback completionHandler);
#endif

[NoiOS, NoTV]
[NoMacCatalyst]
Expand Down
2 changes: 0 additions & 2 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46203,7 +46203,6 @@ M:WebKit.IWKUIDelegate.RequestMediaCapturePermission(WebKit.WKWebView,WebKit.WKS
M:WebKit.IWKUIDelegate.RequestMediaCapturePermissionAsync(WebKit.WKWebView,WebKit.WKSecurityOrigin,WebKit.WKFrameInfo,WebKit.WKMediaCaptureType)
M:WebKit.IWKUIDelegate.RunJavaScriptAlertPanel(WebKit.WKWebView,System.String,WebKit.WKFrameInfo,System.Action)
M:WebKit.IWKUIDelegate.RunJavaScriptConfirmPanel(WebKit.WKWebView,System.String,WebKit.WKFrameInfo,System.Action{System.Boolean})
M:WebKit.IWKUIDelegate.RunJavaScriptTextInputPanel(WebKit.WKWebView,System.String,System.String,WebKit.WKFrameInfo,System.Action{System.String})
M:WebKit.IWKUIDelegate.RunOpenPanel(WebKit.WKWebView,WebKit.WKOpenPanelParameters,WebKit.WKFrameInfo,System.Action{Foundation.NSUrl[]})
M:WebKit.IWKUIDelegate.SetContextMenuConfiguration(WebKit.WKWebView,WebKit.WKContextMenuElementInfo,System.Action{UIKit.UIContextMenuConfiguration})
M:WebKit.IWKUIDelegate.ShouldPreviewElement(WebKit.WKWebView,WebKit.WKPreviewElementInfo)
Expand Down Expand Up @@ -46490,7 +46489,6 @@ M:WebKit.WKUIDelegate_Extensions.RequestMediaCapturePermission(WebKit.IWKUIDeleg
M:WebKit.WKUIDelegate_Extensions.RequestMediaCapturePermissionAsync(WebKit.IWKUIDelegate,WebKit.WKWebView,WebKit.WKSecurityOrigin,WebKit.WKFrameInfo,WebKit.WKMediaCaptureType)
M:WebKit.WKUIDelegate_Extensions.RunJavaScriptAlertPanel(WebKit.IWKUIDelegate,WebKit.WKWebView,System.String,WebKit.WKFrameInfo,System.Action)
M:WebKit.WKUIDelegate_Extensions.RunJavaScriptConfirmPanel(WebKit.IWKUIDelegate,WebKit.WKWebView,System.String,WebKit.WKFrameInfo,System.Action{System.Boolean})
M:WebKit.WKUIDelegate_Extensions.RunJavaScriptTextInputPanel(WebKit.IWKUIDelegate,WebKit.WKWebView,System.String,System.String,WebKit.WKFrameInfo,System.Action{System.String})
M:WebKit.WKUIDelegate_Extensions.RunOpenPanel(WebKit.IWKUIDelegate,WebKit.WKWebView,WebKit.WKOpenPanelParameters,WebKit.WKFrameInfo,System.Action{Foundation.NSUrl[]})
M:WebKit.WKUIDelegate_Extensions.SetContextMenuConfiguration(WebKit.IWKUIDelegate,WebKit.WKWebView,WebKit.WKContextMenuElementInfo,System.Action{UIKit.UIContextMenuConfiguration})
M:WebKit.WKUIDelegate_Extensions.ShouldPreviewElement(WebKit.IWKUIDelegate,WebKit.WKWebView,WebKit.WKPreviewElementInfo)
Expand Down

8 comments on commit dfb9a22

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.