Add WKWebView._mainFrame SPI
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Aug 2018 19:43:20 +0000 (19:43 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Aug 2018 19:43:20 +0000 (19:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188925

Reviewed by Brian Burg.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mainFrame]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235328 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h

index f6b8722..83097a1 100644 (file)
@@ -1,3 +1,14 @@
+2018-08-24  Alex Christensen  <achristensen@webkit.org>
+
+        Add WKWebView._mainFrame SPI
+        https://bugs.webkit.org/show_bug.cgi?id=188925
+
+        Reviewed by Brian Burg.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _mainFrame]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+
 2018-08-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
 
         [Curl] Match the interface used in NetworkDataTask and ResourceHandle.
index ec93611..003a193 100644 (file)
@@ -6484,6 +6484,13 @@ static WebCore::UserInterfaceLayoutDirection toUserInterfaceLayoutDirection(UISe
     return nil;
 }
 
+- (_WKFrameHandle *)_mainFrame
+{
+    if (auto* frame = _page->mainFrame())
+        return wrapper(API::FrameHandle::create(frame->frameID()));
+    return nil;
+}
+
 - (void)_denyNextUserMediaRequest
 {
 #if ENABLE(MEDIA_STREAM)
index de01133..a3c5fa0 100644 (file)
@@ -470,6 +470,7 @@ typedef NS_OPTIONS(NSUInteger, _WKRectEdge) {
 - (void)_setDefersLoadingForTesting:(BOOL)defersLoading;
 
 @property (nonatomic, readonly) _WKInspector *_inspector WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+@property (nonatomic, readonly) _WKFrameHandle *_mainFrame WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 @end