<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[207820] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/207820">207820</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2016-10-25 08:52:25 -0700 (Tue, 25 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add WKWebView fullscreen delegate SPI
https://bugs.webkit.org/show_bug.cgi?id=163674

Reviewed by Anders Carlsson.

Source/WebKit2:

Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits.

* UIProcess/API/APIFullscreenClient.h: Added.
(API::FullscreenClient::~FullscreenClient):
(API::FullscreenClient::willEnterFullscreen):
(API::FullscreenClient::didEnterFullscreen):
(API::FullscreenClient::willExitFullscreen):
(API::FullscreenClient::didExitFullscreen):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _setFullscreenDelegate:]):
(-[WKWebView _fullscreenDelegate]):
(-[WKWebView _isInFullscreen]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added.
* UIProcess/Cocoa/FullscreenClient.h: Added.
(WebKit::FullscreenClient::~FullscreenClient):
* UIProcess/Cocoa/FullscreenClient.mm: Added.
(WebKit::FullscreenClient::FullscreenClient):
(WebKit::FullscreenClient::delegate):
(WebKit::FullscreenClient::setDelegate):
(WebKit::FullscreenClient::willEnterFullscreen):
(WebKit::FullscreenClient::didEnterFullscreen):
(WebKit::FullscreenClient::willExitFullscreen):
(WebKit::FullscreenClient::didExitFullscreen):
* UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
(WebKit::WebFullScreenManagerProxy::willExitFullScreen):
(WebKit::WebFullScreenManagerProxy::didExitFullScreen):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setFullscreenClient):
(WebKit::WebPageProxy::fullScreenManager): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::fullscreenClient):
* WebKit2.xcodeproj/project.pbxproj:

Tools:

Add a new API test which verifies that the fullscreen delegate receives notifications.

* TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm:
(-[FullscreenDelegateMessageHandler userContentController:didReceiveScriptMessage:]):
(-[FullscreenDelegateMessageHandler _webViewWillEnterFullscreen:]):
(-[FullscreenDelegateMessageHandler _webViewDidEnterFullscreen:]):
(-[FullscreenDelegateMessageHandler _webViewWillExitFullscreen:]):
(-[FullscreenDelegateMessageHandler _webViewDidExitFullscreen:]):
(TestWebKitAPI::TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebFullScreenManagerProxycpp">trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIFullscreenClienth">trunk/Source/WebKit2/UIProcess/API/APIFullscreenClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKFullscreenDelegateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFullscreenDelegate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaFullscreenClienth">trunk/Source/WebKit2/UIProcess/Cocoa/FullscreenClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaFullscreenClientmm">trunk/Source/WebKit2/UIProcess/Cocoa/FullscreenClient.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaFullscreenDelegatehtml">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.html</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaFullscreenDelegatemm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (207819 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-10-25 15:52:10 UTC (rev 207819)
+++ trunk/Source/WebKit2/ChangeLog        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2016-10-19  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        Add WKWebView fullscreen delegate SPI
+        https://bugs.webkit.org/show_bug.cgi?id=163674
+
+        Reviewed by Anders Carlsson.
+
+        Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits.
+
+        * UIProcess/API/APIFullscreenClient.h: Added.
+        (API::FullscreenClient::~FullscreenClient):
+        (API::FullscreenClient::willEnterFullscreen):
+        (API::FullscreenClient::didEnterFullscreen):
+        (API::FullscreenClient::willExitFullscreen):
+        (API::FullscreenClient::didExitFullscreen):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]):
+        (-[WKWebView _setFullscreenDelegate:]):
+        (-[WKWebView _fullscreenDelegate]):
+        (-[WKWebView _isInFullscreen]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added.
+        * UIProcess/Cocoa/FullscreenClient.h: Added.
+        (WebKit::FullscreenClient::~FullscreenClient):
+        * UIProcess/Cocoa/FullscreenClient.mm: Added.
+        (WebKit::FullscreenClient::FullscreenClient):
+        (WebKit::FullscreenClient::delegate):
+        (WebKit::FullscreenClient::setDelegate):
+        (WebKit::FullscreenClient::willEnterFullscreen):
+        (WebKit::FullscreenClient::didEnterFullscreen):
+        (WebKit::FullscreenClient::willExitFullscreen):
+        (WebKit::FullscreenClient::didExitFullscreen):
+        * UIProcess/WebFullScreenManagerProxy.cpp:
+        (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
+        (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
+        (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
+        (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::setFullscreenClient):
+        (WebKit::WebPageProxy::fullScreenManager): Deleted.
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::fullscreenClient):
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2016-10-25  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIFullscreenClienth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/APIFullscreenClient.h (0 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIFullscreenClient.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIFullscreenClient.h        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+namespace WebKit {
+class WebPageProxy;
+}
+
+namespace API {
+
+class FullscreenClient {
+public:
+    virtual ~FullscreenClient() { }
+
+    virtual void willEnterFullscreen(WebKit::WebPageProxy*) { }
+    virtual void didEnterFullscreen(WebKit::WebPageProxy*) { }
+    virtual void willExitFullscreen(WebKit::WebPageProxy*) { }
+    virtual void didExitFullscreen(WebKit::WebPageProxy*) { }
+};
+
+} // namespace API
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (207819 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-10-25 15:52:10 UTC (rev 207819)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #import &quot;CompletionHandlerCallChecker.h&quot;
</span><span class="cx"> #import &quot;DiagnosticLoggingClient.h&quot;
</span><span class="cx"> #import &quot;FindClient.h&quot;
</span><ins>+#import &quot;FullscreenClient.h&quot;
</ins><span class="cx"> #import &quot;LegacySessionStateCoding.h&quot;
</span><span class="cx"> #import &quot;Logging.h&quot;
</span><span class="cx"> #import &quot;NavigationState.h&quot;
</span><span class="lines">@@ -67,6 +68,7 @@
</span><span class="cx"> #import &quot;WebBackForwardList.h&quot;
</span><span class="cx"> #import &quot;WebCertificateInfo.h&quot;
</span><span class="cx"> #import &quot;WebFormSubmissionListenerProxy.h&quot;
</span><ins>+#import &quot;WebFullScreenManagerProxy.h&quot;
</ins><span class="cx"> #import &quot;WebKitSystemInterface.h&quot;
</span><span class="cx"> #import &quot;WebPageGroup.h&quot;
</span><span class="cx"> #import &quot;WebPageProxy.h&quot;
</span><span class="lines">@@ -77,6 +79,7 @@
</span><span class="cx"> #import &quot;_WKDiagnosticLoggingDelegate.h&quot;
</span><span class="cx"> #import &quot;_WKFindDelegate.h&quot;
</span><span class="cx"> #import &quot;_WKFrameHandleInternal.h&quot;
</span><ins>+#import &quot;_WKFullscreenDelegate.h&quot;
</ins><span class="cx"> #import &quot;_WKHitTestResultInternal.h&quot;
</span><span class="cx"> #import &quot;_WKInputDelegate.h&quot;
</span><span class="cx"> #import &quot;_WKRemoteObjectRegistryInternal.h&quot;
</span><span class="lines">@@ -550,6 +553,10 @@
</span><span class="cx">     _page-&gt;setFindClient(std::make_unique&lt;WebKit::FindClient&gt;(self));
</span><span class="cx">     _page-&gt;setDiagnosticLoggingClient(std::make_unique&lt;WebKit::DiagnosticLoggingClient&gt;(self));
</span><span class="cx"> 
</span><ins>+#if ENABLE(FULLSCREEN_API)
+    _page-&gt;setFullscreenClient(std::make_unique&lt;WebKit::FullscreenClient&gt;(self));
+#endif
+
</ins><span class="cx">     pageToViewMap().add(_page.get(), self);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3922,6 +3929,31 @@
</span><span class="cx">     return _page-&gt;process().responsivenessTimer().isResponsive();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_setFullscreenDelegate:(id&lt;_WKFullscreenDelegate&gt;)delegate
+{
+#if ENABLE(FULLSCREEN_API)
+    static_cast&lt;WebKit::FullscreenClient&amp;&gt;(_page-&gt;fullscreenClient()).setDelegate(delegate);
+#endif
+}
+
+- (id&lt;_WKFullscreenDelegate&gt;)_fullscreenDelegate
+{
+#if ENABLE(FULLSCREEN_API)
+    return static_cast&lt;WebKit::FullscreenClient&amp;&gt;(_page-&gt;fullscreenClient()).delegate().autorelease());
+#else
+    return nullptr;
+#endif
+}
+
+- (BOOL)_isInFullscreen
+{
+#if ENABLE(FULLSCREEN_API)
+    return _page-&gt;fullScreenManager() &amp;&amp; _page-&gt;fullScreenManager()-&gt;isFullScreen();
+#else
+    return false;
+#endif
+}
+
</ins><span class="cx"> #pragma mark iOS-specific methods
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (207819 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2016-10-25 15:52:10 UTC (rev 207819)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> @protocol _WKDiagnosticLoggingDelegate;
</span><span class="cx"> @protocol _WKFindDelegate;
</span><span class="cx"> @protocol _WKInputDelegate;
</span><ins>+@protocol _WKFullscreenDelegate;
</ins><span class="cx"> 
</span><span class="cx"> @interface WKWebView (WKPrivate)
</span><span class="cx"> 
</span><span class="lines">@@ -244,6 +245,9 @@
</span><span class="cx"> 
</span><span class="cx"> @property (nonatomic, readonly) BOOL _webProcessIsResponsive WK_API_AVAILABLE(macosx(10.12), ios(10.0));
</span><span class="cx"> 
</span><ins>+@property (nonatomic, setter=_setFullscreenDelegate:) id&lt;_WKFullscreenDelegate&gt; _fullscreenDelegate WK_API_AVAILABLE(macos(10.13));
+@property (nonatomic, readonly) BOOL _isInFullscreen WK_API_AVAILABLE(macos(WK_MAC_TBA));
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #if !TARGET_OS_IPHONE
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKFullscreenDelegateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFullscreenDelegate.h (0 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFullscreenDelegate.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKFullscreenDelegate.h        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 &lt;WebKit/WKFoundation.h&gt;
+
+#if WK_API_ENABLED
+
+@protocol _WKFullscreenDelegate &lt;NSObject&gt;
+
+@optional
+
+- (void)_webViewWillEnterFullscreen:(WKWebView *)webView;
+- (void)_webViewDidEnterFullscreen:(WKWebView *)webView;
+- (void)_webViewWillExitFullscreen:(WKWebView *)webView;
+- (void)_webViewDidExitFullscreen:(WKWebView *)webView;
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaFullscreenClienth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/Cocoa/FullscreenClient.h (0 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/FullscreenClient.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/FullscreenClient.h        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#import &quot;WKFoundation.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;APIFullscreenClient.h&quot;
+#import &quot;WeakObjCPtr.h&quot;
+#import &lt;wtf/RetainPtr.h&gt;
+
+@class WKWebView;
+@protocol _WKFullscreenDelegate;
+
+namespace WebKit {
+
+class FullscreenClient : public API::FullscreenClient {
+public:
+    explicit FullscreenClient(WKWebView *);
+    ~FullscreenClient() { };
+
+    RetainPtr&lt;id&lt;_WKFullscreenDelegate&gt;&gt; delegate();
+    void setDelegate(id&lt;_WKFullscreenDelegate&gt;);
+
+    void willEnterFullscreen(WebPageProxy*) override;
+    void didEnterFullscreen(WebPageProxy*) override;
+    void willExitFullscreen(WebPageProxy*) override;
+    void didExitFullscreen(WebPageProxy*) override;
+
+private:
+    WKWebView *m_webView;
+    WeakObjCPtr&lt;id &lt;_WKFullscreenDelegate&gt; &gt; m_delegate;
+
+    struct {
+        bool webViewWillEnterFullscreen : 1;
+        bool webViewDidEnterFullscreen : 1;
+        bool webViewWillExitFullscreen : 1;
+        bool webViewDidExitFullscreen : 1;
+    } m_delegateMethods;
+};
+    
+} // namespace WebKit
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaFullscreenClientmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/Cocoa/FullscreenClient.mm (0 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/FullscreenClient.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/FullscreenClient.mm        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 &quot;config.h&quot;
+#import &quot;FullscreenClient.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;_WKFullscreenDelegate.h&quot;
+
+namespace WebKit {
+
+FullscreenClient::FullscreenClient(WKWebView *webView)
+    : m_webView(webView)
+{
+}
+
+RetainPtr&lt;id &lt;_WKFullscreenDelegate&gt;&gt; FullscreenClient::delegate()
+{
+    return m_delegate.get();
+}
+
+void FullscreenClient::setDelegate(id &lt;_WKFullscreenDelegate&gt; delegate)
+{
+    m_delegate = delegate;
+
+    m_delegateMethods.webViewWillEnterFullscreen = [delegate respondsToSelector:@selector(_webViewWillEnterFullscreen:)];
+    m_delegateMethods.webViewDidEnterFullscreen = [delegate respondsToSelector:@selector(_webViewDidEnterFullscreen:)];
+    m_delegateMethods.webViewWillExitFullscreen = [delegate respondsToSelector:@selector(_webViewWillExitFullscreen:)];
+    m_delegateMethods.webViewDidExitFullscreen = [delegate respondsToSelector:@selector(_webViewDidExitFullscreen:)];
+}
+
+void FullscreenClient::willEnterFullscreen(WebPageProxy*)
+{
+    if (m_delegateMethods.webViewWillEnterFullscreen)
+        [m_delegate.get() _webViewWillEnterFullscreen:m_webView];
+}
+
+void FullscreenClient::didEnterFullscreen(WebPageProxy*)
+{
+    if (m_delegateMethods.webViewDidEnterFullscreen)
+        [m_delegate.get() _webViewDidEnterFullscreen:m_webView];
+}
+
+void FullscreenClient::willExitFullscreen(WebPageProxy*)
+{
+    if (m_delegateMethods.webViewWillExitFullscreen)
+        [m_delegate.get() _webViewWillExitFullscreen:m_webView];
+}
+
+void FullscreenClient::didExitFullscreen(WebPageProxy*)
+{
+    if (m_delegateMethods.webViewDidExitFullscreen)
+        [m_delegate.get() _webViewDidExitFullscreen:m_webView];
+}
+
+} // namespace WebKit
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebFullScreenManagerProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp (207819 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp        2016-10-25 15:52:10 UTC (rev 207819)
+++ trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx"> 
</span><ins>+#include &quot;APIFullscreenClient.h&quot;
</ins><span class="cx"> #include &quot;WebFullScreenManagerMessages.h&quot;
</span><span class="cx"> #include &quot;WebFullScreenManagerProxyMessages.h&quot;
</span><span class="cx"> #include &quot;WebPageProxy.h&quot;
</span><span class="lines">@@ -56,21 +57,25 @@
</span><span class="cx"> 
</span><span class="cx"> void WebFullScreenManagerProxy::willEnterFullScreen()
</span><span class="cx"> {
</span><ins>+    m_page-&gt;fullscreenClient().willEnterFullscreen(m_page);
</ins><span class="cx">     m_page-&gt;process().send(Messages::WebFullScreenManager::WillEnterFullScreen(), m_page-&gt;pageID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebFullScreenManagerProxy::didEnterFullScreen()
</span><span class="cx"> {
</span><ins>+    m_page-&gt;fullscreenClient().didEnterFullscreen(m_page);
</ins><span class="cx">     m_page-&gt;process().send(Messages::WebFullScreenManager::DidEnterFullScreen(), m_page-&gt;pageID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebFullScreenManagerProxy::willExitFullScreen()
</span><span class="cx"> {
</span><ins>+    m_page-&gt;fullscreenClient().willExitFullscreen(m_page);
</ins><span class="cx">     m_page-&gt;process().send(Messages::WebFullScreenManager::WillExitFullScreen(), m_page-&gt;pageID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebFullScreenManagerProxy::didExitFullScreen()
</span><span class="cx"> {
</span><ins>+    m_page-&gt;fullscreenClient().didExitFullscreen(m_page);
</ins><span class="cx">     m_page-&gt;process().send(Messages::WebFullScreenManager::DidExitFullScreen(), m_page-&gt;pageID());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (207819 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-10-25 15:52:10 UTC (rev 207819)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;APIFindMatchesClient.h&quot;
</span><span class="cx"> #include &quot;APIFormClient.h&quot;
</span><span class="cx"> #include &quot;APIFrameInfo.h&quot;
</span><ins>+#include &quot;APIFullscreenClient.h&quot;
</ins><span class="cx"> #include &quot;APIGeometry.h&quot;
</span><span class="cx"> #include &quot;APIHistoryClient.h&quot;
</span><span class="cx"> #include &quot;APIHitTestResult.h&quot;
</span><span class="lines">@@ -340,6 +341,9 @@
</span><span class="cx">     , m_mainFrame(nullptr)
</span><span class="cx">     , m_userAgent(standardUserAgent())
</span><span class="cx">     , m_treatsSHA1CertificatesAsInsecure(m_configuration-&gt;treatsSHA1SignedCertificatesAsInsecure())
</span><ins>+#if ENABLE(FULLSCREEN_API)
+    , m_fullscreenClient(std::make_unique&lt;API::FullscreenClient&gt;())
+#endif
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     , m_hasReceivedLayerTreeTransactionAfterDidCommitLoad(true)
</span><span class="cx">     , m_firstLayerTreeTransactionIdAfterDidCommitLoad(0)
</span><span class="lines">@@ -4271,6 +4275,11 @@
</span><span class="cx"> {
</span><span class="cx">     return m_fullScreenManager.get();
</span><span class="cx"> }
</span><ins>+
+void WebPageProxy::setFullscreenClient(std::unique_ptr&lt;API::FullscreenClient&gt; client)
+{
+    m_fullscreenClient = WTFMove(client);
+}
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx"> #if (PLATFORM(IOS) &amp;&amp; HAVE(AVKIT)) || (PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE))
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (207819 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-10-25 15:52:10 UTC (rev 207819)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -127,6 +127,7 @@
</span><span class="cx"> class FindClient;
</span><span class="cx"> class FindMatchesClient;
</span><span class="cx"> class FormClient;
</span><ins>+class FullscreenClient;
</ins><span class="cx"> class HistoryClient;
</span><span class="cx"> class LoaderClient;
</span><span class="cx"> class Navigation;
</span><span class="lines">@@ -329,6 +330,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">     WebFullScreenManagerProxy* fullScreenManager();
</span><ins>+
+    API::FullscreenClient&amp; fullscreenClient() const { return *m_fullscreenClient; }
+    void setFullscreenClient(std::unique_ptr&lt;API::FullscreenClient&gt;);
</ins><span class="cx"> #endif
</span><span class="cx"> #if (PLATFORM(IOS) &amp;&amp; HAVE(AVKIT)) || (PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE))
</span><span class="cx">     WebPlaybackSessionManagerProxy* playbackSessionManager();
</span><span class="lines">@@ -1605,6 +1609,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="cx">     RefPtr&lt;WebFullScreenManagerProxy&gt; m_fullScreenManager;
</span><ins>+    std::unique_ptr&lt;API::FullscreenClient&gt; m_fullscreenClient;
</ins><span class="cx"> #endif
</span><span class="cx"> #if (PLATFORM(IOS) &amp;&amp; HAVE(AVKIT)) || (PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE))
</span><span class="cx">     RefPtr&lt;WebPlaybackSessionManagerProxy&gt; m_playbackSessionManager;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (207819 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-10-25 15:52:10 UTC (rev 207819)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -1759,6 +1759,10 @@
</span><span class="cx">                 CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA45131ACC8800EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp */; };
</span><span class="cx">                 CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA48131ACD8E00EEDED2 /* WebFullScreenManagerMessageReceiver.cpp */; };
</span><span class="cx">                 CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA37131A29FE00EEDED2 /* WebFullScreenManager.cpp */; };
</span><ins>+                CD78E1141DB7D7ED0014A2DE /* FullscreenClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD78E1121DB7D7ED0014A2DE /* FullscreenClient.mm */; };
+                CD78E1151DB7D7ED0014A2DE /* FullscreenClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD78E1131DB7D7ED0014A2DE /* FullscreenClient.h */; };
+                CD78E1171DB7DC0A0014A2DE /* APIFullscreenClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD78E1161DB7DC0A0014A2DE /* APIFullscreenClient.h */; };
+                CD78E1191DB7E5AD0014A2DE /* _WKFullscreenDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = CD78E1181DB7E5AD0014A2DE /* _WKFullscreenDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 CDA041F41ACE2105004A13EC /* BackBoardServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA041F31ACE2105004A13EC /* BackBoardServicesSPI.h */; };
</span><span class="cx">                 CDA29A1A1CBDBF4100901CCF /* WebPlaybackSessionManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDA29A181CBDBF4100901CCF /* WebPlaybackSessionManager.mm */; };
</span><span class="cx">                 CDA29A1B1CBDBF4100901CCF /* WebPlaybackSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDA29A191CBDBF4100901CCF /* WebPlaybackSessionManager.h */; };
</span><span class="lines">@@ -3901,6 +3905,10 @@
</span><span class="cx">                 CD73BA48131ACD8E00EEDED2 /* WebFullScreenManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFullScreenManagerMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD73BA49131ACD8E00EEDED2 /* WebFullScreenManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFullScreenManagerMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD73BA4A131ACD8F00EEDED2 /* WebFullScreenManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFullScreenManagerProxyMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CD78E1121DB7D7ED0014A2DE /* FullscreenClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FullscreenClient.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD78E1131DB7D7ED0014A2DE /* FullscreenClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullscreenClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD78E1161DB7DC0A0014A2DE /* APIFullscreenClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIFullscreenClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD78E1181DB7E5AD0014A2DE /* _WKFullscreenDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKFullscreenDelegate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDA041F31ACE2105004A13EC /* BackBoardServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackBoardServicesSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDA29A181CBDBF4100901CCF /* WebPlaybackSessionManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPlaybackSessionManager.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDA29A191CBDBF4100901CCF /* WebPlaybackSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPlaybackSessionManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4802,6 +4810,8 @@
</span><span class="cx">                                 A1DF631018E0B7C8003A3E2A /* DownloadClient.mm */,
</span><span class="cx">                                 00B9661818E25AE100CE1F88 /* FindClient.h */,
</span><span class="cx">                                 00B9661718E25AE100CE1F88 /* FindClient.mm */,
</span><ins>+                                CD78E1121DB7D7ED0014A2DE /* FullscreenClient.mm */,
+                                CD78E1131DB7D7ED0014A2DE /* FullscreenClient.h */,
</ins><span class="cx">                                 0F0C365918C0555800F607D7 /* LayerRepresentation.h */,
</span><span class="cx">                                 1ABC3DF41899E437004F0626 /* NavigationState.h */,
</span><span class="cx">                                 1ABC3DF31899E437004F0626 /* NavigationState.mm */,
</span><span class="lines">@@ -5183,6 +5193,7 @@
</span><span class="cx">                                 2DEAC5CE1AC368BB00A195D8 /* _WKFindOptions.h */,
</span><span class="cx">                                 2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */,
</span><span class="cx">                                 37A64E5618F38F4600EB30F1 /* _WKFormInputSession.h */,
</span><ins>+                                CD78E1181DB7E5AD0014A2DE /* _WKFullscreenDelegate.h */,
</ins><span class="cx">                                 37A64E5418F38E3C00EB30F1 /* _WKInputDelegate.h */,
</span><span class="cx">                                 2D790A9C1AD7050D00AB90B3 /* _WKLayoutMode.h */,
</span><span class="cx">                                 9323611D1B015DA800FA9232 /* _WKOverlayScrollbarStyle.h */,
</span><span class="lines">@@ -6254,6 +6265,7 @@
</span><span class="cx">                                 37E25D6D18FDE5D6005D3A00 /* APIFormClient.h */,
</span><span class="cx">                                 2DF9EEE31A781FB400B6CFBE /* APIFrameInfo.cpp */,
</span><span class="cx">                                 2DF9EEE41A781FB400B6CFBE /* APIFrameInfo.h */,
</span><ins>+                                CD78E1161DB7DC0A0014A2DE /* APIFullscreenClient.h */,
</ins><span class="cx">                                 2DABA7751A82B42100EF0F1A /* APIHistoryClient.h */,
</span><span class="cx">                                 93A88B421BC8828C00ABA5C2 /* APIHitTestResult.cpp */,
</span><span class="cx">                                 93A88B431BC8828C00ABA5C2 /* APIHitTestResult.h */,
</span><span class="lines">@@ -7528,6 +7540,7 @@
</span><span class="cx">                                 1AFB4C721ADF155D00B33339 /* _WKWebsiteDataStore.h in Headers */,
</span><span class="cx">                                 1A4A93B71AEB08EA00150E9C /* _WKWebsiteDataStoreInternal.h in Headers */,
</span><span class="cx">                                 A115DC72191D82DA00DA8072 /* _WKWebViewPrintFormatter.h in Headers */,
</span><ins>+                                CD78E1191DB7E5AD0014A2DE /* _WKFullscreenDelegate.h in Headers */,
</ins><span class="cx">                                 A19DD3C01D07D16800AC823B /* _WKWebViewPrintFormatterInternal.h in Headers */,
</span><span class="cx">                                 A182D5B51BE6BD250087A7CC /* AccessibilityIOS.h in Headers */,
</span><span class="cx">                                 A7D792D81767CCA300881CBE /* ActivityAssertion.h in Headers */,
</span><span class="lines">@@ -8275,6 +8288,7 @@
</span><span class="cx">                                 8372DB251A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h in Headers */,
</span><span class="cx">                                 1AB8A1F418400B8F00E9AE69 /* WKPageFindClient.h in Headers */,
</span><span class="cx">                                 1AB8A1F618400B9D00E9AE69 /* WKPageFindMatchesClient.h in Headers */,
</span><ins>+                                CD78E1151DB7D7ED0014A2DE /* FullscreenClient.h in Headers */,
</ins><span class="cx">                                 1AB8A1F018400B0000E9AE69 /* WKPageFormClient.h in Headers */,
</span><span class="cx">                                 BC7B633712A45ABA00D174A4 /* WKPageGroup.h in Headers */,
</span><span class="cx">                                 2D9EA30D1A96CB59002D2807 /* WKPageInjectedBundleClient.h in Headers */,
</span><span class="lines">@@ -8306,6 +8320,7 @@
</span><span class="cx">                                 9391074F1BF6BC65008C17AD /* WKPreviewElementInfoInternal.h in Headers */,
</span><span class="cx">                                 0FCB4E6618BBE3D9000FCFC9 /* WKPrintingView.h in Headers */,
</span><span class="cx">                                 BCBAACEB145225E30053F82F /* WKProcessGroup.h in Headers */,
</span><ins>+                                CD78E1171DB7DC0A0014A2DE /* APIFullscreenClient.h in Headers */,
</ins><span class="cx">                                 BCBAACED145225E30053F82F /* WKProcessGroupPrivate.h in Headers */,
</span><span class="cx">                                 1A15841A189044F50017616C /* WKProcessPool.h in Headers */,
</span><span class="cx">                                 1A3CC16918907EB0001E6ED8 /* WKProcessPoolInternal.h in Headers */,
</span><span class="lines">@@ -9213,6 +9228,7 @@
</span><span class="cx">                                 E4436ECD1A0D040B00EAD204 /* NetworkCacheKey.cpp in Sources */,
</span><span class="cx">                                 831EEBBE1BD85C4300BB64C3 /* NetworkCacheSpeculativeLoad.cpp in Sources */,
</span><span class="cx">                                 832AE2531BE2E8CD00FAAE10 /* NetworkCacheSpeculativeLoadManager.cpp in Sources */,
</span><ins>+                                CD78E1141DB7D7ED0014A2DE /* FullscreenClient.mm in Sources */,
</ins><span class="cx">                                 83BDCCB91AC5FDB6003F6441 /* NetworkCacheStatistics.cpp in Sources */,
</span><span class="cx">                                 E4436ED01A0D040B00EAD204 /* NetworkCacheStorage.cpp in Sources */,
</span><span class="cx">                                 8310428C1BD6B66F00A715E4 /* NetworkCacheSubresourcesEntry.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (207819 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-10-25 15:52:10 UTC (rev 207819)
+++ trunk/Tools/ChangeLog        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-10-19  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        Add WKWebView fullscreen delegate SPI
+        https://bugs.webkit.org/show_bug.cgi?id=163674
+
+        Reviewed by Anders Carlsson.
+
+        Add a new API test which verifies that the fullscreen delegate receives notifications.
+
+        * TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm:
+        (-[FullscreenDelegateMessageHandler userContentController:didReceiveScriptMessage:]):
+        (-[FullscreenDelegateMessageHandler _webViewWillEnterFullscreen:]):
+        (-[FullscreenDelegateMessageHandler _webViewDidEnterFullscreen:]):
+        (-[FullscreenDelegateMessageHandler _webViewWillExitFullscreen:]):
+        (-[FullscreenDelegateMessageHandler _webViewDidExitFullscreen:]):
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2016-10-24  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         URLParser should match old URL::parse with %2E in path
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (207819 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-10-25 15:52:10 UTC (rev 207819)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -473,6 +473,8 @@
</span><span class="cx">                 C5E1AFFE16B221F1006CC1F2 /* execCopy.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C5E1AFFD16B22179006CC1F2 /* execCopy.html */; };
</span><span class="cx">                 CD59F53419E9110D00CF1835 /* file-with-mse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53219E910AA00CF1835 /* file-with-mse.html */; };
</span><span class="cx">                 CD59F53519E9110D00CF1835 /* test-mse.mp4 in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD59F53319E910BC00CF1835 /* test-mse.mp4 */; };
</span><ins>+                CD78E11D1DB7EA660014A2DE /* FullscreenDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD78E11A1DB7EA360014A2DE /* FullscreenDelegate.mm */; };
+                CD78E11E1DB7EE2A0014A2DE /* FullscreenDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD78E11B1DB7EA360014A2DE /* FullscreenDelegate.html */; };
</ins><span class="cx">                 CD9E292E1C90C33F000BB800 /* audio-only.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD9E292D1C90C1BA000BB800 /* audio-only.html */; };
</span><span class="cx">                 CDBFCC451A9FF45300A7B691 /* FullscreenZoomInitialFrame.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */; };
</span><span class="cx">                 CDBFCC461A9FF49E00A7B691 /* FullscreenZoomInitialFrame.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDBFCC421A9FF44800A7B691 /* FullscreenZoomInitialFrame.html */; };
</span><span class="lines">@@ -567,6 +569,7 @@
</span><span class="cx">                                 8349D3C41DB9728E004A9F65 /* link-with-download-attribute.html in Copy Resources */,
</span><span class="cx">                                 AD57AC221DA7466E00FF1BDE /* many-iframes.html in Copy Resources */,
</span><span class="cx">                                 F415086D1DA040C50044BE9B /* play-audio-on-click.html in Copy Resources */,
</span><ins>+                                CD78E11E1DB7EE2A0014A2DE /* FullscreenDelegate.html in Copy Resources */,
</ins><span class="cx">                                 F4F137921D9B683E002BEC57 /* large-video-test-now-playing.html in Copy Resources */,
</span><span class="cx">                                 837A35F11D9A1E7D00663C57 /* DownloadRequestBlobURL.html in Copy Resources */,
</span><span class="cx">                                 2E9896151D8F093800739892 /* text-and-password-inputs.html in Copy Resources */,
</span><span class="lines">@@ -1187,6 +1190,8 @@
</span><span class="cx">                 CD59F53219E910AA00CF1835 /* file-with-mse.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;file-with-mse.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD59F53319E910BC00CF1835 /* test-mse.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = &quot;test-mse.mp4&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD773F711C5057DB0002257C /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CD78E11A1DB7EA360014A2DE /* FullscreenDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FullscreenDelegate.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD78E11B1DB7EA360014A2DE /* FullscreenDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FullscreenDelegate.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CD89D0381C4EDB2A00040A04 /* WebCoreNSURLSession.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSURLSession.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD9E292B1C90A71F000BB800 /* RequiresUserActionForPlayback.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RequiresUserActionForPlayback.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD9E292D1C90C1BA000BB800 /* audio-only.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;audio-only.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1393,6 +1398,7 @@
</span><span class="cx">                                 A1A4FE5D18DD3DB700B5EA8A /* Download.mm */,
</span><span class="cx">                                 2D8104CB1BEC13E70020DA46 /* FindInPage.mm */,
</span><span class="cx">                                 2D1FE0AF1AD465C1006CD9E6 /* FixedLayoutSize.mm */,
</span><ins>+                                CD78E11A1DB7EA360014A2DE /* FullscreenDelegate.mm */,
</ins><span class="cx">                                 3F1B52681D3D7129008D60C4 /* FullscreenLayoutConstraints.mm */,
</span><span class="cx">                                 CDE195B31CFE0ADE0053D256 /* FullscreenTopContentInset.mm */,
</span><span class="cx">                                 510477751D298E03009747EB /* IDBDeleteRecovery.mm */,
</span><span class="lines">@@ -1552,6 +1558,7 @@
</span><span class="cx">                                 9984FACD1CFFB038008D198C /* editable-body.html */,
</span><span class="cx">                                 93575C551D30366E000D604D /* focus-inputs.html */,
</span><span class="cx">                                 F4F405BA1D4C0CF8007A9707 /* full-size-autoplaying-video-with-audio.html */,
</span><ins>+                                CD78E11B1DB7EA360014A2DE /* FullscreenDelegate.html */,
</ins><span class="cx">                                 3FBD1B491D39D1DB00E6D6FA /* FullscreenLayoutConstraints.html */,
</span><span class="cx">                                 CDE195B21CFE0ADE0053D256 /* FullscreenTopContentInset.html */,
</span><span class="cx">                                 510477761D298E57009747EB /* IDBDeleteRecovery.html */,
</span><span class="lines">@@ -2540,6 +2547,7 @@
</span><span class="cx">                                 51714EB81CF8CA17004723C4 /* WebProcessKillIDBCleanup.mm in Sources */,
</span><span class="cx">                                 536770341CC8022800D425B1 /* WebScriptObjectDescription.mm in Sources */,
</span><span class="cx">                                 7CCE7ED41A411A7E00447C4C /* WebViewCanPasteURL.mm in Sources */,
</span><ins>+                                CD78E11D1DB7EA660014A2DE /* FullscreenDelegate.mm in Sources */,
</ins><span class="cx">                                 7C83E0421D0A63FD00FEBCF3 /* WebViewCloseInsideDidFinishLoadForFrame.mm in Sources */,
</span><span class="cx">                                 7CCE7ED51A411A7E00447C4C /* WebViewDidCreateJavaScriptContext.mm in Sources */,
</span><span class="cx">                                 7CCE7ED61A411A7E00447C4C /* WebViewDidRemoveFrameFromHierarchy.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaFullscreenDelegatehtml"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.html (0 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.html                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.html        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;script&gt;
+        function load() {
+            window.webkit.messageHandlers.fullscreenChangeHandler.postMessage('load');
+        }
+        document.addEventListener('webkitfullscreenchange', function(event) {
+            window.webkit.messageHandlers.fullscreenChangeHandler.postMessage('fullscreenchange');
+        });
+        document.addEventListener('mousedown', function(event) {
+            // Toggle fullscreen
+            var target = document.getElementById('target');
+            if (document.webkitFullscreenElement == target)
+                document.webkitExitFullscreen();
+            else
+                target.webkitRequestFullScreen();
+        });
+    &lt;/script&gt;
+    &lt;style&gt;
+    #target {
+        background-color: red;
+        width: 150px;
+        height: 150px;
+    }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;load()&quot;&gt;
+    &lt;div id=&quot;target&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaFullscreenDelegatemm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm (0 => 207820)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenDelegate.mm        2016-10-25 15:52:25 UTC (rev 207820)
</span><span class="lines">@@ -0,0 +1,110 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#include &quot;config.h&quot;
+
+#if WK_API_ENABLED &amp;&amp; PLATFORM(MAC)
+
+#import &quot;PlatformUtilities.h&quot;
+#import &lt;WebKit/WKPreferencesPrivate.h&gt;
+#import &lt;WebKit/WKWebViewConfigurationPrivate.h&gt;
+#import &lt;WebKit/WKWebViewPrivate.h&gt;
+#import &lt;WebKit/_WKFullscreenDelegate.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+static bool receivedLoadedMessage;
+static bool receivedWillEnterFullscreenMessage;
+static bool receivedDidEnterFullscreenMessage;
+static bool receivedWillExitFullscreenMessage;
+static bool receivedDidExitFullscreenMessage;
+
+@interface FullscreenDelegateMessageHandler : NSObject &lt;WKScriptMessageHandler, _WKFullscreenDelegate&gt;
+@end
+
+@implementation FullscreenDelegateMessageHandler
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
+{
+    NSString *bodyString = (NSString *)[message body];
+    if ([bodyString isEqualToString:@&quot;load&quot;])
+        receivedLoadedMessage = true;
+}
+
+- (void)_webViewWillEnterFullscreen:(WKWebView *)view
+{
+    receivedWillEnterFullscreenMessage = true;
+}
+
+- (void)_webViewDidEnterFullscreen:(WKWebView *)view
+{
+    receivedDidEnterFullscreenMessage = true;
+}
+
+- (void)_webViewWillExitFullscreen:(WKWebView *)view
+{
+    receivedWillExitFullscreenMessage = true;
+}
+
+- (void)_webViewDidExitFullscreen:(WKWebView *)view
+{
+    receivedDidExitFullscreenMessage = true;
+}
+@end
+
+namespace TestWebKitAPI {
+
+TEST(Fullscreen, Delegate)
+{
+    RetainPtr&lt;WKWebViewConfiguration&gt; configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    RetainPtr&lt;WKWebView&gt; webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configuration.get()]);
+    [configuration preferences]._fullScreenEnabled = YES;
+    RetainPtr&lt;FullscreenDelegateMessageHandler&gt; handler = adoptNS([[FullscreenDelegateMessageHandler alloc] init]);
+    [[configuration userContentController] addScriptMessageHandler:handler.get() name:@&quot;fullscreenChangeHandler&quot;];
+    [webView _setFullscreenDelegate:handler.get()];
+
+    RetainPtr&lt;NSWindow&gt; window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
+    [[window contentView] addSubview:webView.get()];
+
+    NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@&quot;FullscreenDelegate&quot; withExtension:@&quot;html&quot; subdirectory:@&quot;TestWebKitAPI.resources&quot;]];
+    [webView loadRequest:request];
+    TestWebKitAPI::Util::run(&amp;receivedLoadedMessage);
+
+    NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown location:NSMakePoint(5, 5) modifierFlags:0 timestamp:0 windowNumber:window.get().windowNumber context:0 eventNumber:0 clickCount:0 pressure:0];
+    [webView mouseDown:event];
+
+    ASSERT_FALSE([webView _isInFullscreen]);
+    TestWebKitAPI::Util::run(&amp;receivedWillEnterFullscreenMessage);
+    TestWebKitAPI::Util::run(&amp;receivedDidEnterFullscreenMessage);
+
+    ASSERT_TRUE([webView _isInFullscreen]);
+    [webView mouseDown:event];
+    TestWebKitAPI::Util::run(&amp;receivedWillExitFullscreenMessage);
+    TestWebKitAPI::Util::run(&amp;receivedDidExitFullscreenMessage);
+
+    ASSERT_FALSE([webView _isInFullscreen]);
+}
+
+} // namespace TestWebKitAPI
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>