<!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>[167153] 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/167153">167153</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2014-04-11 14:50:42 -0700 (Fri, 11 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS][WK2] Videos should animate into and out of fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=131497

Reviewed by Simon Fraser.

Source/WebCore:

Use AVPlayerViewController's new enterFullScreenWithCompletionHandler: and exitFullScreenWithCompletionHandler:
methods to animate into and out of full screen. To do so, use the provided initialFrame and finalFrame screen
rects to correctly place the AVPlayerViewController's view before entering or exiting fullscreen.

* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(-[WebVideoFullscreenController enterFullscreen:]): Pass the media element's screen rect.
(-[WebVideoFullscreenController exitFullscreen]): Ditto.
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Renamed from shouldDismissWithReason.
(WebVideoFullscreenInterfaceAVKit::enterFullscreen): Use the new AVKit APIs.
(WebVideoFullscreenInterfaceAVKit::exitFullscreen): Ditto.
* WebCore.exp.in: Modify the exported symbols for enter and exitFullscreen.

Source/WebKit2:

Pass a starting rect for the enterFullscreen animation and an ending rect
for the exitFullscreen animation.

* UIProcess/ios/WebVideoFullscreenManagerProxy.h:
* UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::enterFullscreenWithID): Pass initialFrame.
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::screenRectOfContents): Casts node -&gt; element and returns its screenRect().
(WebKit::WebVideoFullscreenManager::enterFullscreenForNode): Pass initialFrame.
(WebKit::WebVideoFullscreenManager::exitFullscreenForNode): Pass finalFrame.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenControllerAVKitmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxyh">trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymessagesin">trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm">trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermm">trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167152 => 167153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-11 21:41:28 UTC (rev 167152)
+++ trunk/Source/WebCore/ChangeLog        2014-04-11 21:50:42 UTC (rev 167153)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-04-10  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        [iOS][WK2] Videos should animate into and out of fullscreen.
+        https://bugs.webkit.org/show_bug.cgi?id=131497
+
+        Reviewed by Simon Fraser.
+
+        Use AVPlayerViewController's new enterFullScreenWithCompletionHandler: and exitFullScreenWithCompletionHandler:
+        methods to animate into and out of full screen. To do so, use the provided initialFrame and finalFrame screen
+        rects to correctly place the AVPlayerViewController's view before entering or exiting fullscreen.
+
+        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+        (-[WebVideoFullscreenController enterFullscreen:]): Pass the media element's screen rect.
+        (-[WebVideoFullscreenController exitFullscreen]): Ditto.
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Renamed from shouldDismissWithReason.
+        (WebVideoFullscreenInterfaceAVKit::enterFullscreen): Use the new AVKit APIs.
+        (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Ditto.
+        * WebCore.exp.in: Modify the exported symbols for enter and exitFullscreen.
+
</ins><span class="cx"> 2014-04-11  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Support document-relative and custom-frame page overlays
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (167152 => 167153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-04-11 21:41:28 UTC (rev 167152)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-04-11 21:50:42 UTC (rev 167153)
</span><span class="lines">@@ -3300,9 +3300,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO) &amp;&amp; PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 80000
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit11setDurationEd
</span><del>-__ZN7WebCore32WebVideoFullscreenInterfaceAVKit14exitFullscreenEv
</del><ins>+__ZN7WebCore32WebVideoFullscreenInterfaceAVKit14exitFullscreenENS_7IntRectE
</ins><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit14setCurrentTimeEdd
</span><del>-__ZN7WebCore32WebVideoFullscreenInterfaceAVKit15enterFullscreenER7CALayer
</del><ins>+__ZN7WebCore32WebVideoFullscreenInterfaceAVKit15enterFullscreenER7CALayerNS_7IntRectE
</ins><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit17setSeekableRangesERKNS_10TimeRangesE
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit18setVideoDimensionsEbff
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit26setWebVideoFullscreenModelEPNS_23WebVideoFullscreenModelE
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenControllerAVKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (167152 => 167153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm        2014-04-11 21:41:28 UTC (rev 167152)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm        2014-04-11 21:50:42 UTC (rev 167153)
</span><span class="lines">@@ -123,12 +123,12 @@
</span><span class="cx">     _interface-&gt;setWebVideoFullscreenModel(_model.get());
</span><span class="cx">     _model-&gt;setMediaElement(_mediaElement.get());
</span><span class="cx">     _model-&gt;setVideoFullscreenLayer(_videoFullscreenLayer.get());
</span><del>-    _interface-&gt;enterFullscreen(*_videoFullscreenLayer.get());
</del><ins>+    _interface-&gt;enterFullscreen(*_videoFullscreenLayer.get(), _mediaElement-&gt;screenRect());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)exitFullscreen
</span><span class="cx"> {
</span><del>-    _interface-&gt;exitFullscreen();
</del><ins>+    _interface-&gt;exitFullscreen(_mediaElement-&gt;screenRect());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)didEnterFullscreen
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h (167152 => 167153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2014-04-11 21:41:28 UTC (rev 167152)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2014-04-11 21:50:42 UTC (rev 167153)
</span><span class="lines">@@ -83,9 +83,9 @@
</span><span class="cx">     virtual void setSeekableRanges(const TimeRanges&amp;) override;
</span><span class="cx">     virtual void setAudioMediaSelectionOptions(const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex) override;
</span><span class="cx">     virtual void setLegibleMediaSelectionOptions(const Vector&lt;String&gt;&amp; options, uint64_t selectedIndex) override;
</span><del>-        
-    virtual void enterFullscreen(PlatformLayer&amp;);
-    virtual void exitFullscreen();
</del><ins>+
+    virtual void enterFullscreen(PlatformLayer&amp;, WebCore::IntRect initialRect);
+    virtual void exitFullscreen(WebCore::IntRect finalRect);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (167152 => 167153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2014-04-11 21:41:28 UTC (rev 167152)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2014-04-11 21:50:42 UTC (rev 167153)
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx"> @property (retain) NSArray *legibleMediaSelectionOptions;
</span><span class="cx"> @property (retain) WebAVMediaSelectionOption *currentLegibleMediaSelectionOption;
</span><span class="cx"> 
</span><del>-- (BOOL)playerViewController:(AVPlayerViewController *)playerViewController shouldDismissWithReason:(AVPlayerViewControllerExitFullScreenReason)reason;
</del><ins>+- (BOOL)playerViewController:(AVPlayerViewController *)playerViewController shouldExitFullScreenWithReason:(AVPlayerViewControllerExitFullScreenReason)reason;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WebAVPlayerController
</span><span class="lines">@@ -144,12 +144,13 @@
</span><span class="cx">     return self.playerControllerProxy;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (BOOL)playerViewController:(AVPlayerViewController *)playerViewController shouldDismissWithReason:(AVPlayerViewControllerExitFullScreenReason)reason
</del><ins>+- (BOOL)playerViewController:(AVPlayerViewController *)playerViewController shouldExitFullScreenWithReason:(AVPlayerViewControllerExitFullScreenReason)reason
</ins><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(playerViewController);
</span><span class="cx">     UNUSED_PARAM(reason);
</span><span class="cx">     ASSERT(self.delegate);
</span><del>-    self.delegate-&gt;pause();
</del><ins>+    if (reason == AVPlayerViewControllerExitFullScreenReasonDoneButtonTapped || reason == AVPlayerViewControllerExitFullScreenReasonRemoteControlStopEventReceived)
+        self.delegate-&gt;pause();
</ins><span class="cx">     self.delegate-&gt;requestExitFullscreen();
</span><span class="cx">     return NO;
</span><span class="cx"> }
</span><span class="lines">@@ -509,7 +510,7 @@
</span><span class="cx">         playerController().currentLegibleMediaSelectionOption = webOptions[(size_t)selectedIndex];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebVideoFullscreenInterfaceAVKit::enterFullscreen(PlatformLayer&amp; videoLayer)
</del><ins>+void WebVideoFullscreenInterfaceAVKit::enterFullscreen(PlatformLayer&amp; videoLayer, WebCore::IntRect initialRect)
</ins><span class="cx"> {
</span><span class="cx">     __block RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; protect(this);
</span><span class="cx">     
</span><span class="lines">@@ -530,16 +531,25 @@
</span><span class="cx">         [m_playerViewController setDelegate:playerController()];
</span><span class="cx">         
</span><span class="cx">         m_viewController = adoptNS([[classUIViewController alloc] init]);
</span><del>-        
</del><ins>+
</ins><span class="cx">         m_window = adoptNS([[classUIWindow alloc] initWithFrame:[[classUIScreen mainScreen] bounds]]);
</span><span class="cx">         [m_window setBackgroundColor:[classUIColor clearColor]];
</span><span class="cx">         [m_window setRootViewController:m_viewController.get()];
</span><span class="cx">         [m_window makeKeyAndVisible];
</span><del>-        
</del><ins>+
+        [m_viewController addChildViewController:m_playerViewController.get()];
+        [[m_viewController view] addSubview:[m_playerViewController view]];
+        [m_playerViewController view].frame = initialRect;
+        [m_playerViewController didMoveToParentViewController:m_viewController.get()];
+
+        // FIXME: remove the following once &lt;rdar://problem/16578727&gt; is fixed.
+        if ([m_playerViewController respondsToSelector:@selector(_updatePlaybackControlsViewController)])
+            [m_playerViewController performSelector:@selector(_updatePlaybackControlsViewController)];
+
</ins><span class="cx">         __block RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; protect2(this);
</span><span class="cx"> 
</span><span class="cx">         dispatch_async(dispatch_get_main_queue(), ^{
</span><del>-            [m_viewController presentViewController:m_playerViewController.get() animated:YES completion:^{
</del><ins>+            [m_playerViewController enterFullScreenWithCompletionHandler:^(BOOL, NSError*){
</ins><span class="cx">                 if (m_fullscreenChangeObserver)
</span><span class="cx">                     m_fullscreenChangeObserver-&gt;didEnterFullscreen();
</span><span class="cx">                 protect2.clear();
</span><span class="lines">@@ -550,14 +560,15 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebVideoFullscreenInterfaceAVKit::exitFullscreen()
</del><ins>+void WebVideoFullscreenInterfaceAVKit::exitFullscreen(WebCore::IntRect finalRect)
</ins><span class="cx"> {
</span><span class="cx">     __block RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; protect(this);
</span><span class="cx"> 
</span><span class="cx">     m_playerController.clear();
</span><span class="cx">     
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), ^{
</span><del>-        [m_viewController dismissViewControllerAnimated:YES completion:^{
</del><ins>+        [m_playerViewController view].frame = finalRect;
+        [m_playerViewController exitFullScreenWithCompletionHandler:^(BOOL, NSError*){
</ins><span class="cx">             [m_window setHidden:YES];
</span><span class="cx">             [m_window setRootViewController:nil];
</span><span class="cx">             [m_playerViewController setDelegate:nil];
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (167152 => 167153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-11 21:41:28 UTC (rev 167152)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-11 21:50:42 UTC (rev 167153)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-04-10  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        [iOS][WK2] Videos should animate into and out of fullscreen.
+        https://bugs.webkit.org/show_bug.cgi?id=131497
+
+        Reviewed by Simon Fraser.
+
+        Pass a starting rect for the enterFullscreen animation and an ending rect
+        for the exitFullscreen animation.
+
+        * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
+        * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
+        * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
+        (WebKit::WebVideoFullscreenManagerProxy::enterFullscreenWithID): Pass initialFrame.
+        * WebProcess/ios/WebVideoFullscreenManager.mm:
+        (WebKit::screenRectOfContents): Casts node -&gt; element and returns its screenRect().
+        (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): Pass initialFrame.
+        (WebKit::WebVideoFullscreenManager::exitFullscreenForNode): Pass finalFrame.
+
</ins><span class="cx"> 2014-04-11  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Support document-relative and custom-frame page overlays
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h (167152 => 167153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h        2014-04-11 21:41:28 UTC (rev 167152)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.h        2014-04-11 21:50:42 UTC (rev 167153)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&amp;) override;
</span><span class="cx"> 
</span><span class="cx">     // Translate to FullscreenInterface
</span><del>-    virtual void enterFullscreenWithID(uint32_t);
</del><ins>+    virtual void enterFullscreenWithID(uint32_t, WebCore::IntRect initialRect);
</ins><span class="cx">     virtual void setSeekableRangesVector(Vector&lt;std::pair&lt;double, double&gt;&gt;&amp;);
</span><span class="cx"> 
</span><span class="cx">     // Fullscreen Observer
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in (167152 => 167153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in        2014-04-11 21:41:28 UTC (rev 167152)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in        2014-04-11 21:50:42 UTC (rev 167153)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">     SetLegibleMediaSelectionOptions(Vector&lt;String&gt; options, uint64_t selectedIndex);
</span><span class="cx">     SetDuration(double duration)
</span><span class="cx">     SetRate(bool isPlaying, double rate)
</span><del>-    EnterFullscreenWithID(uint32_t videoLayerID)
-    ExitFullscreen()
</del><ins>+    EnterFullscreenWithID(uint32_t videoLayerID, WebCore::IntRect initialRect)
+    ExitFullscreen(WebCore::IntRect finalRect)
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm (167152 => 167153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm        2014-04-11 21:41:28 UTC (rev 167152)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm        2014-04-11 21:50:42 UTC (rev 167153)
</span><span class="lines">@@ -58,11 +58,11 @@
</span><span class="cx">     m_page-&gt;process().removeMessageReceiver(Messages::WebVideoFullscreenManagerProxy::messageReceiverName(), m_page-&gt;pageID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebVideoFullscreenManagerProxy::enterFullscreenWithID(uint32_t videoLayerID)
</del><ins>+void WebVideoFullscreenManagerProxy::enterFullscreenWithID(uint32_t videoLayerID, WebCore::IntRect initialRect)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(videoLayerID);
</span><span class="cx">     m_layerHost = WKMakeRenderLayer(videoLayerID);
</span><del>-    enterFullscreen(*m_layerHost.get());
</del><ins>+    enterFullscreen(*m_layerHost.get(), initialRect);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void WebVideoFullscreenManagerProxy::setSeekableRangesVector(Vector&lt;std::pair&lt;double, double&gt;&gt;&amp; ranges)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm (167152 => 167153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2014-04-11 21:41:28 UTC (rev 167152)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2014-04-11 21:50:42 UTC (rev 167153)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><ins>+#include &quot;WebCoreArgumentCoders.h&quot;
</ins><span class="cx"> #include &quot;WebPage.h&quot;
</span><span class="cx"> #include &quot;WebProcess.h&quot;
</span><span class="cx"> #include &quot;WebVideoFullscreenManagerMessages.h&quot;
</span><span class="lines">@@ -34,8 +35,12 @@
</span><span class="cx"> #include &lt;QuartzCore/CoreAnimation.h&gt;
</span><span class="cx"> #include &lt;WebCore/Event.h&gt;
</span><span class="cx"> #include &lt;WebCore/EventNames.h&gt;
</span><ins>+#include &lt;WebCore/FrameView.h&gt;
</ins><span class="cx"> #include &lt;WebCore/HTMLVideoElement.h&gt;
</span><span class="cx"> #include &lt;WebCore/PlatformCALayer.h&gt;
</span><ins>+#include &lt;WebCore/RenderLayer.h&gt;
+#include &lt;WebCore/RenderLayerBacking.h&gt;
+#include &lt;WebCore/RenderView.h&gt;
</ins><span class="cx"> #include &lt;WebCore/Settings.h&gt;
</span><span class="cx"> #include &lt;WebCore/TimeRanges.h&gt;
</span><span class="cx"> #include &lt;WebCore/WebCoreThreadRun.h&gt;
</span><span class="lines">@@ -44,6 +49,14 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+static IntRect screenRectForNode(Node* node)
+{
+    if (!node || !node-&gt;isElementNode())
+        return IntRect();
+
+    return toElement(node)-&gt;screenRect();
+}
+
</ins><span class="cx"> PassRefPtr&lt;WebVideoFullscreenManager&gt; WebVideoFullscreenManager::create(PassRefPtr&lt;WebPage&gt; page)
</span><span class="cx"> {
</span><span class="cx">     return adoptRef(new WebVideoFullscreenManager(page));
</span><span class="lines">@@ -86,10 +99,10 @@
</span><span class="cx">     m_layerHostingContext-&gt;setRootLayer(videoLayer);
</span><span class="cx">     setVideoFullscreenLayer(videoLayer);
</span><span class="cx"> 
</span><del>-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::EnterFullscreenWithID(m_layerHostingContext-&gt;contextID()), m_page-&gt;pageID());
</del><ins>+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::EnterFullscreenWithID(m_layerHostingContext-&gt;contextID(), screenRectForNode(node)), m_page-&gt;pageID());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebVideoFullscreenManager::exitFullscreenForNode(Node*)
</del><ins>+void WebVideoFullscreenManager::exitFullscreenForNode(Node* node)
</ins><span class="cx"> {
</span><span class="cx">     m_node.clear();
</span><span class="cx">     m_targetIsFullscreen = false;
</span><span class="lines">@@ -98,7 +111,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_isAnimating = true;
</span><del>-    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::ExitFullscreen(), m_page-&gt;pageID());
</del><ins>+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::ExitFullscreen(screenRectForNode(node)), m_page-&gt;pageID());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebVideoFullscreenManager::setDuration(double duration)
</span></span></pre>
</div>
</div>

</body>
</html>