Skip to content

WebKit macOS xcode13.0 beta1

Manuel de la Pena edited this page Oct 19, 2021 · 4 revisions

#WebKit.framework ##mandel https://github.com/xamarin/xamarin-macios/pull/11957

diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/NSAttributedString.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/NSAttributedString.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/NSAttributedString.h	2021-03-16 09:54:34.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/NSAttributedString.h	2021-06-02 12:44:08.000000000 -0400
@@ -70,7 +70,7 @@
  document-level attributes, or an error.
 */
 + (void)loadFromHTMLWithRequest:(NSURLRequest *)request options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options completionHandler:(NSAttributedStringCompletionHandler)completionHandler
-    NS_SWIFT_NAME(loadFromHTML(request:options:completionHandler:)) API_AVAILABLE(macos(10.15), ios(13.0));
+    NS_SWIFT_NAME(loadFromHTML(request:options:completionHandler:)) WK_SWIFT_ASYNC_NAME(fromHTML(request:options:)) API_AVAILABLE(macos(10.15), ios(13.0));
 
 /*!
  @abstract Converts a local HTML file into an attributed string.
@@ -85,7 +85,7 @@
  files inside that directory may be loaded by WebKit.
 */
 + (void)loadFromHTMLWithFileURL:(NSURL *)fileURL options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options completionHandler:(NSAttributedStringCompletionHandler)completionHandler
-    NS_SWIFT_NAME(loadFromHTML(fileURL:options:completionHandler:)) API_AVAILABLE(macos(10.15), ios(13.0));
+    NS_SWIFT_NAME(loadFromHTML(fileURL:options:completionHandler:)) WK_SWIFT_ASYNC_NAME(fromHTML(fileURL:options:)) API_AVAILABLE(macos(10.15), ios(13.0));
 
 /*!
  @abstract Converts an HTML string into an attributed string.
@@ -99,7 +99,7 @@
  within the document.
 */
 + (void)loadFromHTMLWithString:(NSString *)string options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options completionHandler:(NSAttributedStringCompletionHandler)completionHandler
-    NS_SWIFT_NAME(loadFromHTML(string:options:completionHandler:)) API_AVAILABLE(macos(10.15), ios(13.0));
+    NS_SWIFT_NAME(loadFromHTML(string:options:completionHandler:)) WK_SWIFT_ASYNC_NAME(fromHTML(_:options:)) API_AVAILABLE(macos(10.15), ios(13.0));
 
 /*!
  @abstract Converts HTML data into an attributed string.
@@ -113,7 +113,7 @@
  NSCharacterEncodingDocumentOption is supplied, a best-guess encoding is used.
 */
 + (void)loadFromHTMLWithData:(NSData *)data options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options completionHandler:(NSAttributedStringCompletionHandler)completionHandler
-    NS_SWIFT_NAME(loadFromHTML(data:options:completionHandler:)) API_AVAILABLE(macos(10.15), ios(13.0));
+    NS_SWIFT_NAME(loadFromHTML(data:options:completionHandler:)) WK_SWIFT_ASYNC_NAME(fromHTML(_:options:)) API_AVAILABLE(macos(10.15), ios(13.0));
 
 @end
 
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKContentRuleListStore.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKContentRuleListStore.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKContentRuleListStore.h	2021-03-16 09:54:34.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKContentRuleListStore.h	2021-06-02 11:07:05.000000000 -0400
@@ -35,9 +35,12 @@
 + (instancetype)defaultStore;
 + (instancetype)storeWithURL:(NSURL *)url;
 
-- (void)compileContentRuleListForIdentifier:(NSString *)identifier encodedContentRuleList:(NSString *) encodedContentRuleList completionHandler:(void (^)(WKContentRuleList *, NSError *))completionHandler;
-- (void)lookUpContentRuleListForIdentifier:(NSString *)identifier completionHandler:(void (^)(WKContentRuleList *, NSError *))completionHandler;
+- (void)compileContentRuleListForIdentifier:(NSString *)identifier encodedContentRuleList:(NSString *)encodedContentRuleList completionHandler:(void (^)(WKContentRuleList *, NSError *))completionHandler;
+
+- (void)lookUpContentRuleListForIdentifier:(NSString *)identifier completionHandler:(void (^)(WKContentRuleList *, NSError *))completionHandler WK_SWIFT_ASYNC_NAME(contentRuleList(forIdentifier:));
+
 - (void)removeContentRuleListForIdentifier:(NSString *)identifier completionHandler:(void (^)(NSError *))completionHandler;
-- (void)getAvailableContentRuleListIdentifiers:(void (^)(NSArray<NSString *>*))completionHandler;
+
+- (void)getAvailableContentRuleListIdentifiers:(void (^)(NSArray<NSString *> *))completionHandler WK_SWIFT_ASYNC_NAME(availableIdentifiers());
 
 @end
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKDownloadDelegate.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKDownloadDelegate.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKDownloadDelegate.h	2021-03-16 09:54:35.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKDownloadDelegate.h	2021-06-02 11:08:40.000000000 -0400
@@ -68,7 +68,7 @@
  to proceed with the redirection.
  @discussion If you do not implement this method, all server suggested redirects will be taken.
  */
-- (void)download:(WKDownload *)download willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request decisionHandler:(void (^)(WKDownloadRedirectPolicy))decisionHandler;
+- (void)download:(WKDownload *)download willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request decisionHandler:(void (^)(WKDownloadRedirectPolicy))decisionHandler WK_SWIFT_ASYNC_NAME(download(_:decidedPolicyForHTTPRedirection:newRequest:)) WK_SWIFT_ASYNC(4);
 
 /* @abstract Invoked when the download needs to respond to an authentication challenge.
  @param download The download that received the authentication challenge.
@@ -80,7 +80,7 @@
  credential.
  @discussion If you do not implement this method, the web view will respond to the authentication challenge with the NSURLSessionAuthChallengeRejectProtectionSpace disposition.
  */
-- (void)download:(WKDownload *)download didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler;
+- (void)download:(WKDownload *)download didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler WK_SWIFT_ASYNC_NAME(download(_:respondTo:));
 
 /* @abstract Invoked when the download has finished successfully.
  @param download The download that finished.
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKFoundation.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKFoundation.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKFoundation.h	2021-03-16 04:44:21.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKFoundation.h	2021-06-01 23:08:47.000000000 -0400
@@ -32,3 +32,15 @@
 #define WK_EXTERN extern __attribute__((visibility ("default")))
 #endif
 
+#ifdef NS_SWIFT_ASYNC_NAME
+#define WK_SWIFT_ASYNC_NAME(...) NS_SWIFT_ASYNC_NAME(__VA_ARGS__)
+#else
+#define WK_SWIFT_ASYNC_NAME(...)
+#endif
+
+#ifdef NS_SWIFT_ASYNC
+#define WK_SWIFT_ASYNC(...) NS_SWIFT_ASYNC(__VA_ARGS__)
+#else
+#define WK_SWIFT_ASYNC(...)
+#endif
+
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKHTTPCookieStore.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKHTTPCookieStore.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKHTTPCookieStore.h	2021-03-16 09:54:35.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKHTTPCookieStore.h	2021-06-02 11:07:06.000000000 -0400
@@ -59,7 +59,7 @@
 /*! @abstract Delete the specified cookie.
  @param completionHandler A block to invoke once the cookie has been deleted.
  */
-- (void)deleteCookie:(NSHTTPCookie *)cookie completionHandler:(nullable void (^)(void))completionHandler;
+- (void)deleteCookie:(NSHTTPCookie *)cookie completionHandler:(nullable void (^)(void))completionHandler WK_SWIFT_ASYNC_NAME(deleteCookie(_:));
 
 /*! @abstract Adds a WKHTTPCookieStoreObserver object with the cookie store.
  @param observer The observer object to add.
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKMediaPlaybackState.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKMediaPlaybackState.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKMediaPlaybackState.h	2021-03-16 09:54:30.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKMediaPlaybackState.h	1969-12-31 19:00:00.000000000 -0500
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Foundation/Foundation.h>
-#import <WebKit/WKFoundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-typedef NS_ENUM(NSUInteger, WKMediaPlaybackState) {
-    WKMediaPlaybackStateNone,
-    WKMediaPlaybackStatePaused,
-    WKMediaPlaybackStateSuspended,
-    WKMediaPlaybackStatePlaying
-} API_AVAILABLE(macos(11.3), ios(14.5));
-
-NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKNavigationDelegate.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKNavigationDelegate.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKNavigationDelegate.h	2021-03-16 09:56:04.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKNavigationDelegate.h	2021-06-02 11:06:58.000000000 -0400
@@ -77,7 +77,7 @@
  navigation. The argument is one of the constants of the enumerated type WKNavigationActionPolicy.
  @discussion If you do not implement this method, the web view will load the request or, if appropriate, forward it to another application.
  */
-- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler;
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler WK_SWIFT_ASYNC(3);
 
 /*! @abstract Decides whether to allow or cancel a navigation.
  @param webView The web view invoking the delegate method.
@@ -91,7 +91,7 @@
  @discussion If you implement this method,
  -webView:decidePolicyForNavigationAction:decisionHandler: will not be called.
  */
-- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction preferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler API_AVAILABLE(macos(10.15), ios(13.0));
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction preferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler WK_SWIFT_ASYNC(4) API_AVAILABLE(macos(10.15), ios(13.0));
 
 /*! @abstract Decides whether to allow or cancel a navigation after its
  response is known.
@@ -102,7 +102,7 @@
  navigation. The argument is one of the constants of the enumerated type WKNavigationResponsePolicy.
  @discussion If you do not implement this method, the web view will allow the response, if the web view can show it.
  */
-- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler;
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler WK_SWIFT_ASYNC(3);
 
 /*! @abstract Invoked when a main frame navigation starts.
  @param webView The web view invoking the delegate method.
@@ -155,7 +155,7 @@
  credential.
  @discussion If you do not implement this method, the web view will respond to the authentication challenge with the NSURLSessionAuthChallengeRejectProtectionSpace disposition.
  */
-- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler;
+- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler WK_SWIFT_ASYNC_NAME(webView(_:respondTo:));
 
 /*! @abstract Invoked when the web view's web content process is terminated.
  @param webView The web view whose underlying web content process was terminated.
@@ -167,7 +167,7 @@
  @param challenge The authentication challenge.
  @param decisionHandler The decision handler you must invoke to respond to indicate whether or not to continue with the connection establishment.
  */
-- (void)webView:(WKWebView *)webView authenticationChallenge:(NSURLAuthenticationChallenge *)challenge shouldAllowDeprecatedTLS:(void (^)(BOOL))decisionHandler API_AVAILABLE(macos(11.0), ios(14.0));
+- (void)webView:(WKWebView *)webView authenticationChallenge:(NSURLAuthenticationChallenge *)challenge shouldAllowDeprecatedTLS:(void (^)(BOOL))decisionHandler WK_SWIFT_ASYNC_NAME(webView(_:shouldAllowDeprecatedTLSFor:)) WK_SWIFT_ASYNC(3) API_AVAILABLE(macos(11.0), ios(14.0));
 
 /*
  @abstract Called after using WKNavigationActionPolicyDownload.
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKPreferences.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKPreferences.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKPreferences.h	2021-03-16 09:54:29.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKPreferences.h	2021-06-02 11:07:00.000000000 -0400
@@ -62,7 +62,7 @@
 
 /*! @abstract A Boolean value indicating whether text interaction is disabled.
 */
-@property (nonatomic) BOOL textInteractionEnabled API_AVAILABLE(macos(11.3), ios(14.5));
+@property (nonatomic, getter=isTextInteractionEnabled) BOOL textInteractionEnabled API_AVAILABLE(macos(11.3), ios(14.5));
 
 @end
 
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKScriptMessageHandlerWithReply.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKScriptMessageHandlerWithReply.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKScriptMessageHandlerWithReply.h	2021-03-16 08:47:30.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKScriptMessageHandlerWithReply.h	2021-06-02 11:07:00.000000000 -0400
@@ -87,7 +87,8 @@
    - The JavaScript promise is fulfilled with the value 42.
    - JavaScript execution continues and the value 42 is returned.
  */
-- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message replyHandler:(void (^)(id _Nullable reply, NSString *_Nullable errorMessage))replyHandler API_AVAILABLE(macos(11.0), ios(14.0));
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message replyHandler:(void (^)(id _Nullable reply, NSString *_Nullable errorMessage))replyHandler WK_SWIFT_ASYNC(3) API_AVAILABLE(macos(11.0), ios(14.0));
+
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKUIDelegate.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKUIDelegate.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKUIDelegate.h	2021-03-16 09:54:32.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKUIDelegate.h	2021-06-02 12:44:08.000000000 -0400
@@ -45,6 +45,18 @@
 @protocol UIContextMenuInteractionCommitAnimating;
 #endif
 
+typedef NS_ENUM(NSInteger, WKPermissionDecision) {
+    WKPermissionDecisionPrompt,
+    WKPermissionDecisionGrant,
+    WKPermissionDecisionDeny,
+} API_AVAILABLE(macos(11.3), ios(14.5));
+
+typedef NS_ENUM(NSInteger, WKMediaCaptureType) {
+    WKMediaCaptureTypeCamera,
+    WKMediaCaptureTypeMicrophone,
+    WKMediaCaptureTypeCameraAndMicrophone,
+} API_AVAILABLE(macos(11.3), ios(14.5));
+
 /*! A class conforming to the WKUIDelegate protocol provides methods for
  presenting native UI on behalf of a webpage.
  */
@@ -123,6 +135,24 @@
  */
 - (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(nullable NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString * _Nullable result))completionHandler;
 
+
+/*! @abstract A delegate to request permission for microphone audio and camera video access.
+ @param webView The web view invoking the delegate method.
+ @param origin The origin of the page.
+ @param frame Information about the frame whose JavaScript initiated this call.
+ @param type The type of capture (camera, microphone).
+ @param decisionHandler The completion handler to call once the decision is made
+ @discussion If not implemented, the result is the same as calling the decisionHandler with WKPermissionDecisionPrompt.
+ */
+- (void)webView:(WKWebView *)webView requestMediaCapturePermissionForOrigin:(WKSecurityOrigin *)origin initiatedByFrame:(WKFrameInfo *)frame type:(WKMediaCaptureType)type decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler WK_SWIFT_ASYNC_NAME(webView(_:decideMediaCapturePermissionsFor:initiatedBy:type:)) WK_SWIFT_ASYNC(5) API_AVAILABLE(macos(11.3), ios(14.5));
+
+/*! @abstract Allows your app to determine whether or not the given security origin should have access to the device's orientation and motion.
+ @param securityOrigin The security origin which requested access to the device's orientation and motion.
+ @param frame The frame that initiated the request.
+ @param decisionHandler The decision handler to call once the app has made its decision.
+ */
+- (void)webView:(WKWebView *)webView requestDeviceOrientationAndMotionPermissionForOrigin:(WKSecurityOrigin *)origin initiatedByFrame:(WKFrameInfo *)frame decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler API_AVAILABLE(ios(14.5)) API_UNAVAILABLE(macos);
+
 #if TARGET_OS_IPHONE
 
 /*! @abstract Allows your app to determine whether or not the given element should show a preview.
@@ -157,7 +187,6 @@
  @param previewingViewController The view controller that is being popped.
  */
 - (void)webView:(WKWebView *)webView commitPreviewingViewController:(UIViewController *)previewingViewController API_DEPRECATED_WITH_REPLACEMENT("webView:contextMenuForElement:willCommitWithAnimator:", ios(10.0, 13.0));
-
 #endif // TARGET_OS_IPHONE
 
 #if TARGET_OS_IOS
@@ -171,7 +200,7 @@
  * Pass a valid UIContextMenuConfiguration to show a context menu, or pass nil to not show a context menu.
  */
 
-- (void)webView:(WKWebView *)webView contextMenuConfigurationForElement:(WKContextMenuElementInfo *)elementInfo completionHandler:(void (^)(UIContextMenuConfiguration * _Nullable configuration))completionHandler API_AVAILABLE(ios(13.0));
+- (void)webView:(WKWebView *)webView contextMenuConfigurationForElement:(WKContextMenuElementInfo *)elementInfo completionHandler:(void (^)(UIContextMenuConfiguration * _Nullable configuration))completionHandler WK_SWIFT_ASYNC_NAME(webView(_:contextMenuConfigurationFor:)) API_AVAILABLE(ios(13.0));
 
 /**
  * @abstract Called when the context menu will be presented.
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebView.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebView.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebView.h	2021-03-16 09:56:05.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebView.h	2021-06-02 11:07:03.000000000 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -25,8 +25,6 @@
 
 #import <WebKit/WKFoundation.h>
 
-#import <WebKit/WKMediaPlaybackState.h>
-
 #if TARGET_OS_IPHONE
 #import <UIKit/UIKit.h>
 #else
@@ -63,6 +61,19 @@
 @interface WKWebView : NSView
 #endif
 
+typedef NS_ENUM(NSInteger, WKMediaPlaybackState) {
+    WKMediaPlaybackStateNone,
+    WKMediaPlaybackStatePlaying,
+    WKMediaPlaybackStatePaused,
+    WKMediaPlaybackStateSuspended
+} API_AVAILABLE(macos(11.3), ios(14.5));
+
+typedef NS_ENUM(NSInteger, WKMediaCaptureState) {
+    WKMediaCaptureStateNone,
+    WKMediaCaptureStateActive,
+    WKMediaCaptureStateMuted,
+} API_AVAILABLE(macos(11.3), ios(14.5));
+
 /*! @abstract A copy of the configuration with which the web view was
  initialized. */
 @property (nonatomic, readonly, copy) WKWebViewConfiguration *configuration;
@@ -322,36 +333,69 @@
 
  The above function text will create a promise that will fulfull with the value 42 after a one second delay, wait for it to resolve, then return the fulfillment value of 42.
 */
+#ifdef NS_SWIFT_ASYNC_NAME
+- (void)callAsyncJavaScript:(NSString *)functionBody arguments:(nullable NSDictionary<NSString *, id> *)arguments inFrame:(nullable WKFrameInfo *)frame inContentWorld:(WKContentWorld *)contentWorld completionHandler:(void (^ _Nullable)(_Nullable_result id, NSError * _Nullable error))completionHandler NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(11.0), ios(14.0));
+#else
 - (void)callAsyncJavaScript:(NSString *)functionBody arguments:(nullable NSDictionary<NSString *, id> *)arguments inFrame:(nullable WKFrameInfo *)frame inContentWorld:(WKContentWorld *)contentWorld completionHandler:(void (^ _Nullable)(_Nullable id, NSError * _Nullable error))completionHandler NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(11.0), ios(14.0));
+#endif
 
 /*! @abstract Closes all out-of-window media presentations in a WKWebView.
  @discussion Includes picture-in-picture and fullscreen.
  */
-- (void)closeAllMediaPresentations API_AVAILABLE(macos(11.3), ios(14.5));
+- (void)closeAllMediaPresentationsWithCompletionHandler:(void (^_Nullable)(void))completionHandler API_AVAILABLE(macos(11.3), ios(14.5));
 
 /*! @abstract Pauses media playback in WKWebView.
- @discussion Pauses media playback. Media in the page can be restarted by calling play() on a media element or resume() on an AudioContext.
- */
-- (void)pauseAllMediaPlayback:(void (^_Nullable)(void))completionHandler API_AVAILABLE(macos(11.3), ios(14.5));
-
-/*! @abstract Suspends media playback in WKWebView.
- @discussion Pauses media playback and blocks all attempts by the page to resume until resumeAllMediaPlayback is called. This should always be called in pairs with resumeAllMediaPlayback.
+ @discussion Pauses media playback. Media in the page can be restarted by calling play() on a media element or resume() on an AudioContext in JavaScript. A user can also use media controls to play media content after it has been paused.
  */
-- (void)suspendAllMediaPlayback:(void (^_Nullable)(void))completionHandler API_AVAILABLE(macos(11.3), ios(14.5));
+- (void)pauseAllMediaPlaybackWithCompletionHandler:(void (^_Nullable)(void))completionHandler API_AVAILABLE(macos(11.3), ios(14.5));
 
-/*! @abstract Resumes media playback in WKWebView.
- @discussion This should always be called in pairs with suspendAllMediaPlayback.
- */
-- (void)resumeAllMediaPlayback:(void (^ _Nullable)(void))completionHandler API_AVAILABLE(macos(11.3), ios(14.5));
+/*! @abstract Suspends or resumes all media playback in WKWebView.
+  @param suspended Whether media playback should be suspended or resumed.
+  @discussion If suspended is true, this pauses media playback and blocks all attempts by the page or the user to resume until setAllMediaPlaybackSuspended is called again with suspended set to false. Media playback should always be suspended and resumed in pairs.
+*/
+- (void)setAllMediaPlaybackSuspended:(BOOL)suspended completionHandler:(void (^_Nullable)(void))completionHandler API_AVAILABLE(macos(11.3), ios(14.5));
 
 /*! @abstract Get the current media playback state of a WKWebView.
  @param completionHandler A block to invoke with the return value of the function call.
  @discussion If media playback exists, WKMediaPlaybackState will be one of three
  values: WKMediaPlaybackPaused, WKMediaPlaybackSuspended, or WKMediaPlaybackPlaying.
  If no media playback exists in the current WKWebView, WKMediaPlaybackState will equal
- WKNoMediaPlayback.
+ WKMediaPlaybackStateNone.
+ */
+- (void)requestMediaPlaybackStateWithCompletionHandler:(void (^)(WKMediaPlaybackState))completionHandler API_AVAILABLE(macos(11.3), ios(14.5));
+
+
+/*! @abstract The state of camera capture on a web page.
+ @discussion @link WKWebView @/link is key-value observing (KVO) compliant
+ for this property.
+ */
+@property (nonatomic, readonly) WKMediaCaptureState cameraCaptureState API_AVAILABLE(macos(11.3), ios(14.5));
+
+/*! @abstract The state of microphone capture on a web page.
+ @discussion @link WKWebView @/link is key-value observing (KVO) compliant
+ for this property.
  */
-- (void)requestMediaPlaybackState:(void (^)(WKMediaPlaybackState))completionHandler API_AVAILABLE(macos(11.3), ios(14.5));
+@property (nonatomic, readonly) WKMediaCaptureState microphoneCaptureState API_AVAILABLE(macos(11.3), ios(14.5));
+
+/*! @abstract Set camera capture state of a WKWebView.
+ @param state State to apply for capture.
+ @param completionHandler A block to invoke after the camera state has been changed.
+ @discussion
+ If value is WKMediaCaptureStateNone, this will stop any camera capture.
+ If value is WKMediaCaptureStateMuted, any active camera capture will become muted.
+ If value is WKMediaCaptureStateActive, any muted camera capture will become active.
+ */
+- (void)setCameraCaptureState:(WKMediaCaptureState)state completionHandler:(void (^_Nullable)(void))completionHandler API_AVAILABLE(macos(11.3), ios(14.5));
+
+/*! @abstract Set microphone capture state of a WKWebView.
+ @param state state to apply for capture.
+ @param completionHandler A block to invoke after the camera state has been changed.
+ @discussion
+ If value is WKMediaCaptureStateNone, this will stop any microphone capture.
+ If value is WKMediaCaptureStateMuted, any active microphone capture will become muted.
+ If value is WKMediaCaptureStateActive, any muted microphone capture will become active.
+ */
+- (void)setMicrophoneCaptureState:(WKMediaCaptureState)state completionHandler:(void (^_Nullable)(void))completionHandler API_AVAILABLE(macos(11.3), ios(14.5));
 
 /*! @abstract Get a snapshot for the visible viewport of WKWebView.
  @param snapshotConfiguration An object that specifies how the snapshot is configured.
@@ -361,9 +405,9 @@
  device scale. The completionHandler is passed the image of the viewport contents or an error.
  */
 #if TARGET_OS_IPHONE
-- (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(UIImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler API_AVAILABLE(ios(11.0));
+- (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(UIImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_SWIFT_ASYNC_NAME(takeSnapshot(configuration:)) API_AVAILABLE(ios(11.0));
 #else
-- (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(NSImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.13));
+- (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(NSImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_SWIFT_ASYNC_NAME(takeSnapshot(configuration:)) API_AVAILABLE(macos(10.13));
 #endif
 
 /*! @abstract Create a PDF document representation from the web page currently displayed in the WKWebView
@@ -472,12 +516,70 @@
 */
 @property (nonatomic, nullable, copy) NSString *mediaType API_AVAILABLE(macos(11.0), ios(14.0));
 
+/* @abstract The interaction state for the WKWebView
+ @discussion The interaction state (back-forward list, currently loaded page, scroll position, form data...) for the WKWebView, which
+ can be retrieved and set on another WKWebView to restore state.
+*/
+@property (nonatomic, nullable, copy) id interactionState API_AVAILABLE(macos(11.3), ios(14.5));
+
+/*! @abstract Sets the webpage contents from the passed data as if it was the
+ response to the supplied request. The request is never actually sent to the
+ supplied URL, though loads of resources defined in the NSData object would
+ be performed.
+ @param request The request specifying the base URL and other loading details
+ to be used while interpreting the supplied data object.
+ @param response A response that is used to interpret the supplied data object.
+ @param data The data to use as the contents of the webpage.
+ @result A new navigation.
+*/
+- (WKNavigation *)loadSimulatedRequest:(NSURLRequest *)request response:(NSURLResponse *)response responseData:(NSData *)data API_AVAILABLE(macos(11.3), ios(14.5));
+- (WKNavigation *)loadSimulatedRequest:(NSURLRequest *)request withResponse:(NSURLResponse *)response responseData:(NSData *)data API_DEPRECATED_WITH_REPLACEMENT("loadSimulatedRequest:response:responseData:", macos(11.3, 11.3), ios(14.5, 14.5));
+
+/*! @abstract Navigates to the requested file URL on the filesystem.
+ @param request The request specifying the file URL to which to navigate.
+ @param readAccessURL The URL to allow read access to.
+ @discussion If readAccessURL references a single file, only that file may be
+ loaded by WebKit.
+ If readAccessURL references a directory, files inside that file may be loaded by WebKit.
+ @result A new navigation for the given file URL.
+*/
+- (WKNavigation *)loadFileRequest:(NSURLRequest *)request allowingReadAccessToURL:(NSURL *)readAccessURL API_AVAILABLE(macos(11.3), ios(14.5));
+
+/*! @abstract Sets the webpage contents from the passed HTML string as if it was
+ the response to the supplied request. The request is never actually sent to the
+ supplied URL, though loads of resources defined in the HTML string would be
+ performed.
+ @param request The request specifying the base URL and other loading details
+ to be used while interpreting the supplied data object.
+ @param string The data to use as the contents of the webpage.
+ @result A new navigation.
+*/
+- (WKNavigation *)loadSimulatedRequest:(NSURLRequest *)request responseHTMLString:(NSString *)string NS_SWIFT_NAME(loadSimulatedRequest(_:responseHTML:)) API_AVAILABLE(macos(11.3), ios(14.5));
+- (WKNavigation *)loadSimulatedRequest:(NSURLRequest *)request withResponseHTMLString:(NSString *)string NS_SWIFT_NAME(loadSimulatedRequest(_:withResponseHTML:)) API_DEPRECATED_WITH_REPLACEMENT("loadSimulatedRequest:responseHTMLString:", macos(11.3, 11.3), ios(14.5, 14.5));
+
 #if !TARGET_OS_IPHONE
 /* @abstract Returns an NSPrintOperation object configured to print the contents of this WKWebView
 @param printInfo The print info object used to configure the resulting print operation.
 */
 - (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo API_AVAILABLE(macos(11.0));
 #endif
+
+/*! @abstract The theme color of the active page.
+ @discussion This is the CSS color parsed value of the `contents`
+ attribute of the first valid
+ @textblock
+    <meta name="theme-color" contents="...">
+ @/textblock
+ element in the current main document.
+ @link WKWebView @/link is key-value observing (KVO) compliant for this
+ property.
+ */
+#if TARGET_OS_IPHONE
+@property (nonatomic, readonly, nullable) UIColor *themeColor API_AVAILABLE(ios(14.5));
+#else
+@property (nonatomic, readonly, nullable) NSColor *themeColor API_AVAILABLE(macos(11.3));
+#endif
+
 @end
 
 #if !TARGET_OS_IPHONE
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h	2021-03-16 09:56:04.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h	2021-06-02 12:47:05.000000000 -0400
@@ -128,6 +128,11 @@
  */
 @property (nonatomic) BOOL allowsAirPlayForMediaPlayback API_AVAILABLE(macos(10.11), ios(9.0));
 
+/*! @abstract A Boolean value indicating whether HTTP requests to servers known to support HTTPS should be automatically upgraded to HTTPS requests.
+ @discussion The default value is YES.
+ */
+@property (nonatomic) BOOL upgradeKnownHostsToHTTPS API_AVAILABLE(macos(11.3), ios(14.5));
+
 @property (nonatomic) WKAudiovisualMediaTypes mediaTypesRequiringUserActionForPlayback API_AVAILABLE(macos(10.12), ios(10.0));
 
 /*! @abstract The set of default webpage preferences to use when loading and rendering content.
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h	2021-03-16 09:54:31.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h	2021-06-02 11:08:39.000000000 -0400
@@ -60,7 +60,7 @@
   @param dataTypes The website data types to fetch records for.
   @param completionHandler A block to invoke when the data records have been fetched.
 */
-- (void)fetchDataRecordsOfTypes:(NSSet<NSString *> *)dataTypes completionHandler:(void (^)(NSArray<WKWebsiteDataRecord *> *))completionHandler;
+- (void)fetchDataRecordsOfTypes:(NSSet<NSString *> *)dataTypes completionHandler:(void (^)(NSArray<WKWebsiteDataRecord *> *))completionHandler WK_SWIFT_ASYNC_NAME(dataRecords(ofTypes:));
 
 /*! @abstract Removes website data of the given types for the given data records.
  @param dataTypes The website data types that should be removed.
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.h	2021-03-16 04:44:21.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.h	2021-06-01 23:08:49.000000000 -0400
@@ -38,7 +38,6 @@
 #import <WebKit/WKFoundation.h>
 #import <WebKit/WKFrameInfo.h>
 #import <WebKit/WKHTTPCookieStore.h>
-#import <WebKit/WKMediaPlaybackState.h>
 #import <WebKit/WKNavigation.h>
 #import <WebKit/WKNavigationAction.h>
 #import <WebKit/WKNavigationDelegate.h>
Clone this wiki locally