[Cocoa] Need SPI to determine if the WKWebView is displaying a standalone image
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jun 2014 20:54:21 +0000 (20:54 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jun 2014 20:54:21 +0000 (20:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134071

Reviewed by Anders Carlsson.

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

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

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

index ccebb6e..86c1042 100644 (file)
@@ -1,3 +1,14 @@
+2014-06-19  Sam Weinig  <sam@webkit.org>
+
+        [Cocoa] Need SPI to determine if the WKWebView is displaying a standalone image
+        https://bugs.webkit.org/show_bug.cgi?id=134071
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _isDisplayingStandaloneImageDocument]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+
 2014-06-19  Dan Bernstein  <mitz@apple.com>
 
         Use a single map for all callback types in WebPageProxy
index da19b21..82d9ebc 100644 (file)
@@ -1750,6 +1750,13 @@ static inline WebKit::FindOptions toFindOptions(_WKFindOptions wkFindOptions)
         _page->setFormClient(nullptr);
 }
 
+- (BOOL)_isDisplayingStandaloneImageDocument
+{
+    if (auto* mainFrame = _page->mainFrame())
+        return mainFrame->isDisplayingStandaloneImageDocument();
+    return NO;
+}
+
 #pragma mark iOS-specific methods
 
 #if PLATFORM(IOS)
index 3199324..caa830c 100644 (file)
@@ -174,6 +174,8 @@ typedef NS_OPTIONS(NSUInteger, _WKFindOptions) {
 
 @property (nonatomic, weak, setter=_setFormDelegate:) id <_WKFormDelegate> _formDelegate;
 
+@property (nonatomic, readonly, getter=_isDisplayingStandaloneImageDocument) BOOL _displayingStandaloneImageDocument;
+
 @end
 
 #endif