Expose WKPageRef as a private property on WKWebView on Mac
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Sep 2017 17:45:06 +0000 (17:45 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Sep 2017 17:45:06 +0000 (17:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177022
<rdar://problem/34342762>

Reviewed by Andy Estes.

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

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

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

index 7375d00..4c07d44 100644 (file)
@@ -1,5 +1,17 @@
 2017-09-19  Alex Christensen  <achristensen@webkit.org>
 
+        Expose WKPageRef as a private property on WKWebView on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=177022
+        <rdar://problem/34342762>
+
+        Reviewed by Andy Estes.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _pageRefForTransitionToWKWebView]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+
+2017-09-19  Alex Christensen  <achristensen@webkit.org>
+
         Make _WKProcessPoolConfiguration.allowsCellularAccess actually work on iOS
         https://bugs.webkit.org/show_bug.cgi?id=177124
 
index f52f2f4..f99d2f3 100644 (file)
@@ -5653,6 +5653,11 @@ static WebCore::UserInterfaceLayoutDirection toUserInterfaceLayoutDirection(UISe
 #endif // PLATFORM(IOS)
 
 #if PLATFORM(MAC)
+- (WKPageRef)_pageRefForTransitionToWKWebView
+{
+    return toAPI(_page.get());
+}
+
 - (BOOL)_hasActiveVideoForControlsManager
 {
     return _page && _page->hasActiveVideoForControlsManager();
index 24ceaa9..6d9f610 100644 (file)
@@ -67,6 +67,8 @@ typedef NS_ENUM(NSUInteger, _WKDragInteractionPolicy) {
     _WKDragInteractionPolicyAlwaysDisable
 } WK_API_AVAILABLE(ios(11.0));
 
+#else
+#import <WebKit/WKBase.h>
 #endif
 
 #if !TARGET_OS_IPHONE
@@ -386,6 +388,7 @@ typedef NS_OPTIONS(NSInteger, _WKRectEdge) {
 #endif // TARGET_OS_IPHONE
 
 #if !TARGET_OS_IPHONE
+@property (nonatomic, readonly) WKPageRef _pageRefForTransitionToWKWebView  WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 @property (nonatomic, readonly) BOOL _hasActiveVideoForControlsManager WK_API_AVAILABLE(macosx(10.12));
 - (void)_requestControlledElementID WK_API_AVAILABLE(macosx(10.12.3));
 - (void)_handleControlledElementIDResponse:(NSString *)identifier WK_API_AVAILABLE(macosx(10.12.3));