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] Fix nullability in WKUIDelegate.RunJavaScriptTextInputPanel for XAMCORE_5_0. #22199

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
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 @@ -48159,7 +48159,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 @@ -48446,7 +48445,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
Loading