<!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>[187272] trunk/Source</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/187272">187272</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2015-07-23 16:46:59 -0700 (Thu, 23 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Notify the UI delegate when a MediaDocument's natural size changes
https://bugs.webkit.org/show_bug.cgi?id=147182

Reviewed by Simon Fraser.

Source/WebCore:

Notify the MediaDocument that it's underlying media element has changed its natural size, either when
the media engine notifies us that the size changed, or when the ready state progresses to HAVE_METADATA.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState): Notify the media document.
(WebCore::HTMLMediaElement::mediaPlayerSizeChanged): Ditto.
* html/MediaDocument.cpp:
(WebCore::MediaDocument::mediaElementNaturalSizeChanged): Pass to the chrome client.
* html/MediaDocument.h:
* page/ChromeClient.h:

Source/WebKit2:

Pipe notifications of media document natural size changes up from the chrome client, through
to the UIProcess,  through the page client, through the WKWebView, to the UIDelegate.

* UIProcess/API/APIUIClient.h:
(API::UIClient::mediaDocumentNaturalSizeChanged):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mediaDocumentNaturalSizeChanged:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::mediaDocumentNaturalSizeChanged):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::mediaDocumentNaturalSizeChanged):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::mediaDocumentNaturalSizeChanged):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mediaDocumentNaturalSizeChanged):
* WebProcess/WebPage/WebPage.h:
* UIProcess/API/gtk/PageClientImpl.h: Add default, empty implementation of new pure-virtual method.
* UIProcess/efl/WebViewEfl.h: Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaDocumentcpp">trunk/Source/WebCore/html/MediaDocument.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaDocumenth">trunk/Source/WebCore/html/MediaDocument.h</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIUIClienth">trunk/Source/WebKit2/UIProcess/API/APIUIClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKUIDelegatePrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkPageClientImplh">trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaUIDelegateh">trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaUIDelegatemm">trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</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="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcesseflWebViewEflh">trunk/Source/WebKit2/UIProcess/efl/WebViewEfl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplh">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplmm">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebCore/ChangeLog        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-07-21  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        Notify the UI delegate when a MediaDocument's natural size changes
+        https://bugs.webkit.org/show_bug.cgi?id=147182
+
+        Reviewed by Simon Fraser.
+
+        Notify the MediaDocument that it's underlying media element has changed its natural size, either when
+        the media engine notifies us that the size changed, or when the ready state progresses to HAVE_METADATA.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::setReadyState): Notify the media document.
+        (WebCore::HTMLMediaElement::mediaPlayerSizeChanged): Ditto.
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocument::mediaElementNaturalSizeChanged): Pass to the chrome client.
+        * html/MediaDocument.h:
+        * page/ChromeClient.h:
+
</ins><span class="cx"> 2015-07-22  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Layer z-ordering is incorrect when scrolling on page witih position:fixed
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -2115,6 +2115,9 @@
</span><span class="cx">         if (renderer())
</span><span class="cx">             renderer()-&gt;updateFromElement();
</span><span class="cx"> 
</span><ins>+        if (is&lt;MediaDocument&gt;(document()))
+            downcast&lt;MediaDocument&gt;(document()).mediaElementNaturalSizeChanged(expandedIntSize(m_player-&gt;naturalSize()));
+
</ins><span class="cx">         logMediaLoadRequest(document().page(), m_player-&gt;engineDescription(), String(), true);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -4386,6 +4389,9 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(Media, &quot;HTMLMediaElement::mediaPlayerSizeChanged(%p)&quot;, this);
</span><span class="cx"> 
</span><ins>+    if (is&lt;MediaDocument&gt;(document()) &amp;&amp; m_player)
+        downcast&lt;MediaDocument&gt;(document()).mediaElementNaturalSizeChanged(expandedIntSize(m_player-&gt;naturalSize()));
+
</ins><span class="cx">     beginProcessingMediaPlayerCallback();
</span><span class="cx">     if (renderer())
</span><span class="cx">         renderer()-&gt;updateFromElement();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaDocument.cpp (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaDocument.cpp        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebCore/html/MediaDocument.cpp        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -28,6 +28,8 @@
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> #include &quot;MediaDocument.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;Chrome.h&quot;
+#include &quot;ChromeClient.h&quot;
</ins><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="lines">@@ -259,5 +261,17 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MediaDocument::mediaElementNaturalSizeChanged(const IntSize&amp; newSize)
+{
+    if (ownerElement())
+        return;
+
+    if (newSize.isZero())
+        return;
+
+    if (page())
+        page()-&gt;chrome().client().mediaDocumentNaturalSizeChanged(newSize);
</ins><span class="cx"> }
</span><ins>+
+}
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaDocument.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaDocument.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebCore/html/MediaDocument.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx">     virtual ~MediaDocument();
</span><span class="cx"> 
</span><span class="cx">     void mediaElementSawUnsupportedTracks();
</span><ins>+    void mediaElementNaturalSizeChanged(const IntSize&amp;);
</ins><span class="cx">     String outgoingReferrer() const { return m_outgoingReferrer; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebCore/page/ChromeClient.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -449,6 +449,10 @@
</span><span class="cx">     virtual void playbackTargetPickerClientStateDidChange(uint64_t /*contextId*/, MediaProducer::MediaStateFlags) { }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    virtual void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;) { }
+#endif
+
</ins><span class="cx"> protected:
</span><span class="cx">     virtual ~ChromeClient() { }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/ChangeLog        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2015-07-21  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        Notify the UI delegate when a MediaDocument's natural size changes
+        https://bugs.webkit.org/show_bug.cgi?id=147182
+
+        Reviewed by Simon Fraser.
+
+        Pipe notifications of media document natural size changes up from the chrome client, through
+        to the UIProcess,  through the page client, through the WKWebView, to the UIDelegate.
+
+        * UIProcess/API/APIUIClient.h:
+        (API::UIClient::mediaDocumentNaturalSizeChanged):
+        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _mediaDocumentNaturalSizeChanged:]):
+        * UIProcess/API/Cocoa/WKWebViewInternal.h:
+        * UIProcess/Cocoa/UIDelegate.h:
+        * UIProcess/Cocoa/UIDelegate.mm:
+        (WebKit::UIDelegate::setDelegate):
+        (WebKit::UIDelegate::UIClient::mediaDocumentNaturalSizeChanged):
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::mediaDocumentNaturalSizeChanged):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::mediaDocumentNaturalSizeChanged):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::mediaDocumentNaturalSizeChanged):
+        * WebProcess/WebPage/WebPage.h:
+        * UIProcess/API/gtk/PageClientImpl.h: Add default, empty implementation of new pure-virtual method.
+        * UIProcess/efl/WebViewEfl.h: Ditto.
+
</ins><span class="cx"> 2015-07-23  Enrica Casucci  &lt;enrica@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Removing one incorrect annotation from the previous change.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIUIClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIUIClient.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIUIClient.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/API/APIUIClient.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -167,6 +167,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     virtual void didClickAutoFillButton(WebKit::WebPageProxy&amp;, API::Object*) { }
</span><ins>+
+#if ENABLE(VIDEO)
+    virtual void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;) { }
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace API
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKUIDelegatePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> - (void)_webViewFullscreenMayReturnToInline:(WKWebView *)webView;
</span><span class="cx"> - (void)_webViewDidEnterFullscreen:(WKWebView *)webView WK_AVAILABLE(WK_MAC_TBA, 8_3);
</span><span class="cx"> - (void)_webViewDidExitFullscreen:(WKWebView *)webView WK_AVAILABLE(WK_MAC_TBA, 8_3);
</span><ins>+- (void)_webView:(WKWebView *)webView mediaDocumentNaturalSizeChanged:(CGSize)size;
</ins><span class="cx"> 
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><span class="cx"> - (BOOL)_webView:(WKWebView *)webView shouldIncludeAppLinkActionsForElement:(_WKActivatedElementInfo *)element WK_AVAILABLE(NA, WK_IOS_TBA);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -1881,6 +1881,15 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // PLATFORM(MAC)
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+- (void)_mediaDocumentNaturalSizeChanged:(NSSize)newSize
+{
+    id &lt;WKUIDelegatePrivate&gt; uiDelegate = static_cast&lt;id &lt;WKUIDelegatePrivate&gt;&gt;([self UIDelegate]);
+    if ([uiDelegate respondsToSelector:@selector(_webView:mediaDocumentNaturalSizeChanged:)])
+        [uiDelegate _webView:self mediaDocumentNaturalSizeChanged:newSize];
+}
+#endif
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WKWebView (WKPrivate)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -116,6 +116,10 @@
</span><span class="cx"> 
</span><span class="cx"> - (WKPageRef)_pageForTesting;
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+- (void)_mediaDocumentNaturalSizeChanged:(CGSize)newSize;
+#endif
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> WKWebView* fromWebPageProxy(WebKit::WebPageProxy&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -135,6 +135,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void didChangeBackgroundColor() override;
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    virtual void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;) override { }
+#endif
+
</ins><span class="cx">     virtual void refView() override;
</span><span class="cx">     virtual void derefView() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaUIDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -76,6 +76,9 @@
</span><span class="cx">         virtual RetainPtr&lt;NSArray&gt; actionsForElement(_WKActivatedElementInfo *, RetainPtr&lt;NSArray&gt; defaultActions) override;
</span><span class="cx">         virtual void didNotHandleTapAsClick(const WebCore::IntPoint&amp;) override;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(VIDEO)
+        virtual void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;) override;
+#endif
</ins><span class="cx"> 
</span><span class="cx">         UIDelegate&amp; m_uiDelegate;
</span><span class="cx">     };
</span><span class="lines">@@ -103,6 +106,9 @@
</span><span class="cx">         bool webViewActionsForElementDefaultActions : 1;
</span><span class="cx">         bool webViewDidNotHandleTapAsClickAtPoint : 1;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(VIDEO)
+        bool webViewMediaDocumentNaturalSizeChanged : 1;
+#endif
</ins><span class="cx">     } m_delegateMethods;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaUIDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -85,6 +85,9 @@
</span><span class="cx">     m_delegateMethods.webViewActionsForElementDefaultActions = [delegate respondsToSelector:@selector(_webView:actionsForElement:defaultActions:)];
</span><span class="cx">     m_delegateMethods.webViewDidNotHandleTapAsClickAtPoint = [delegate respondsToSelector:@selector(_webView:didNotHandleTapAsClickAtPoint:)];
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(VIDEO)
+    m_delegateMethods.webViewMediaDocumentNaturalSizeChanged = [delegate respondsToSelector:@selector(_webView:mediaDocumentNaturalSizeChanged:)];
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> UIDelegate::UIClient::UIClient(UIDelegate&amp; uiDelegate)
</span><span class="lines">@@ -338,6 +341,20 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+void UIDelegate::UIClient::mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp; newSize)
+{
+    if (!m_uiDelegate.m_delegateMethods.webViewMediaDocumentNaturalSizeChanged)
+        return;
+
+    auto delegate = m_uiDelegate.m_delegate.get();
+    if (!delegate)
+        return;
+
+    [static_cast&lt;id &lt;WKUIDelegatePrivate&gt;&gt;(delegate) _webView:m_uiDelegate.m_webView mediaDocumentNaturalSizeChanged:newSize];
+}
+#endif
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // WK_API_ENABLED
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -329,6 +329,10 @@
</span><span class="cx">     virtual WebCore::WebMediaSessionManager&amp; mediaSessionManager() = 0;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    virtual void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;) = 0;
+#endif
+
</ins><span class="cx">     virtual void refView() = 0;
</span><span class="cx">     virtual void derefView() = 0;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -6014,6 +6014,13 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+void WebPageProxy::mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp; newSize)
+{
+    m_uiClient-&gt;mediaDocumentNaturalSizeChanged(newSize);
+}
+#endif
+
</ins><span class="cx"> void WebPageProxy::setShouldDispatchFakeMouseMoveEvents(bool shouldDispatchFakeMouseMoveEvents)
</span><span class="cx"> {
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::SetShouldDispatchFakeMouseMoveEvents(shouldDispatchFakeMouseMoveEvents), m_pageID);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -1477,6 +1477,10 @@
</span><span class="cx">     void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
</span><span class="cx">     void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;);
+#endif
+
</ins><span class="cx">     void handleAutoFillButtonClick(const UserData&amp;);
</span><span class="cx"> 
</span><span class="cx">     void handleMessage(IPC::Connection&amp;, const String&amp; messageName, const UserData&amp; messageBody);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -444,6 +444,10 @@
</span><span class="cx">     PlaybackTargetPickerClientStateDidChange(uint64_t contextId, unsigned mediaState)
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    MediaDocumentNaturalSizeChanged(WebCore::IntSize newSize)
+#endif
+
</ins><span class="cx">     UseFixedLayoutDidChange(bool useFixedLayout)
</span><span class="cx">     FixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize)
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesseflWebViewEflh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/efl/WebViewEfl.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/efl/WebViewEfl.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/efl/WebViewEfl.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -90,6 +90,10 @@
</span><span class="cx">     virtual void didFinishLoadForMainFrame() override final { }
</span><span class="cx">     virtual void didSameDocumentNavigationForMainFrame(SameDocumentNavigationType) override final { }
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    virtual void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;) override final { }
+#endif
+
</ins><span class="cx">     virtual void refView() override final { }
</span><span class="cx">     virtual void derefView() override final { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -186,6 +186,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void didChangeBackgroundColor() override;
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    virtual void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;) override;
+#endif
+
</ins><span class="cx">     virtual void refView() override;
</span><span class="cx">     virtual void derefView() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -739,6 +739,14 @@
</span><span class="cx">     [m_webView _updateScrollViewBackground];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+void PageClientImpl::mediaDocumentNaturalSizeChanged(const IntSize&amp; newSize)
+{
+    [m_webView _mediaDocumentNaturalSizeChanged:newSize];
+}
+#endif
+
+
</ins><span class="cx"> void PageClientImpl::refView()
</span><span class="cx"> {
</span><span class="cx">     [m_contentView retain];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -203,6 +203,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void didChangeBackgroundColor() override;
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    virtual void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;) override;
+#endif
+
</ins><span class="cx">     WKView *m_wkView;
</span><span class="cx">     WKWebView *m_webView;
</span><span class="cx">     RetainPtr&lt;WKEditorUndoTargetObjC&gt; m_undoTarget;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -836,6 +836,13 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+void PageClientImpl::mediaDocumentNaturalSizeChanged(const IntSize&amp; newSize)
+{
+    [m_webView _mediaDocumentNaturalSizeChanged:newSize];
+}
+#endif
+
</ins><span class="cx"> void PageClientImpl::refView()
</span><span class="cx"> {
</span><span class="cx">     CFRetain(m_wkView);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -1158,5 +1158,11 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+void WebChromeClient::mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp; newSize)
+{
+    m_page-&gt;mediaDocumentNaturalSizeChanged(newSize);
+}
+#endif
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -323,6 +323,10 @@
</span><span class="cx">     virtual void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    virtual void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;) override;
+#endif
+
</ins><span class="cx">     String m_cachedToolTip;
</span><span class="cx">     mutable RefPtr&lt;WebFrame&gt; m_cachedFrameSetLargestFrame;
</span><span class="cx">     mutable bool m_cachedMainFrameHasHorizontalScrollbar;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -5031,4 +5031,11 @@
</span><span class="cx">     m_page-&gt;setUserContentExtensionsEnabled(userContentExtensionsEnabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+void WebPage::mediaDocumentNaturalSizeChanged(const IntSize&amp; newSize)
+{
+    send(Messages::WebPageProxy::MediaDocumentNaturalSizeChanged(newSize));
+}
+#endif
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (187271 => 187272)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-07-23 23:43:35 UTC (rev 187271)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-07-23 23:46:59 UTC (rev 187272)
</span><span class="lines">@@ -902,6 +902,10 @@
</span><span class="cx">     void setInputMethodState(bool);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    void mediaDocumentNaturalSizeChanged(const WebCore::IntSize&amp;);
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     WebPage(uint64_t pageID, const WebPageCreationParameters&amp;);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>