<!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>[175750] 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/175750">175750</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2014-11-07 10:10:54 -0800 (Fri, 07 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] Update optimized fullscreen media controls
https://bugs.webkit.org/show_bug.cgi?id=138493

Reviewed by Brent Fulgham.

Source/WebCore:

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::fullscreenMode): New.
(WebCore::MediaControlsHost::mediaUIImageData): New.
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:

* Modules/mediacontrols/mediaControlsiOS.css:
Renamed -webkit-media-controls-wireless-playback-status to -webkit-media-controls-inline-playback-placeholder
    because it is now used for other inline playback status display. Add z-index:0 so the placeholder
    renders above captions. Remove the background-image, it is now set from script.
(audio::-webkit-media-controls-inline-playback-placeholder):
(audio::-webkit-media-controls-inline-playback-placeholder.hidden):
(video::-webkit-media-controls-optimized-fullscreen-button):
(audio::-webkit-media-controls-wireless-playback-status): Deleted.
(audio::-webkit-media-controls-wireless-playback-status.hidden): Deleted.
(video::-webkit-media-controls-optimized-fullscreen-button:active): Deleted.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS): Set doingSetup to true around setup so we don't draw the inline controls
    briefly when an element is created as a result of a user gesture.
(ControllerIOS.prototype.shouldHaveStartPlaybackButton): Don't allow inline controls during
    initial setup to prevent inline controls from begin drawn briefly when a media element
    is created and inserted by a script called from a user gesture.
(ControllerIOS.prototype.updateWirelessPlaybackStatus): wirelessPlaybackStatus -&gt; inlinePlaybackPlaceholder.
(ControllerIOS.prototype.createControls): Ditto. Add style rules for optimized fullscreen button.
(ControllerIOS.prototype.configureInlineControls): Add the inlinePlaybackPlaceholder as a peer of
    the inline controls compositing child instead of as a child so it renders correctly.
(ControllerIOS.prototype.addControls):
(ControllerIOS.prototype.updateControls): wirelessPlaybackStatus -&gt; inlinePlaybackPlaceholder.
(ControllerIOS.prototype.handleWrapperTouchStart):
(ControllerIOS.prototype.get pageScaleFactor): Cleanup.
(ControllerIOS.prototype.set pageScaleFactor): Ditto.
(ControllerIOS.prototype.handleFullscreenChange): Show the placeholder.

* WebCore.exp.in: Export _wkGetMediaUIImageData.

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::fullscreenMode): Expose fullscreen mode.

* platform/ios/WebCoreSystemInterfaceIOS.h:
* platform/ios/WebCoreSystemInterfaceIOS.mm:

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Initialize GetMediaUIImageData.

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Initialize GetMediaUIImageData.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsMediaControlsHostcpp">trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsMediaControlsHosth">trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsMediaControlsHostidl">trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsmediaControlsiOScss">trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsmediaControlsiOSjs">trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebCoreSystemInterfaceIOSh">trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebCoreSystemInterfaceIOSmm">trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebSystemInterfacemm">trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebSystemInterfacemm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebCore/ChangeLog        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2014-11-07  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        [iOS] Update optimized fullscreen media controls
+        https://bugs.webkit.org/show_bug.cgi?id=138493
+
+        Reviewed by Brent Fulgham.
+
+        * Modules/mediacontrols/MediaControlsHost.cpp:
+        (WebCore::MediaControlsHost::fullscreenMode): New.
+        (WebCore::MediaControlsHost::mediaUIImageData): New.
+        * Modules/mediacontrols/MediaControlsHost.h:
+        * Modules/mediacontrols/MediaControlsHost.idl:
+
+        * Modules/mediacontrols/mediaControlsiOS.css:
+        Renamed -webkit-media-controls-wireless-playback-status to -webkit-media-controls-inline-playback-placeholder
+            because it is now used for other inline playback status display. Add z-index:0 so the placeholder
+            renders above captions. Remove the background-image, it is now set from script.
+        (audio::-webkit-media-controls-inline-playback-placeholder): 
+        (audio::-webkit-media-controls-inline-playback-placeholder.hidden):
+        (video::-webkit-media-controls-optimized-fullscreen-button):
+        (audio::-webkit-media-controls-wireless-playback-status): Deleted.
+        (audio::-webkit-media-controls-wireless-playback-status.hidden): Deleted.
+        (video::-webkit-media-controls-optimized-fullscreen-button:active): Deleted.
+
+        * Modules/mediacontrols/mediaControlsiOS.js:
+        (ControllerIOS): Set doingSetup to true around setup so we don't draw the inline controls
+            briefly when an element is created as a result of a user gesture.
+        (ControllerIOS.prototype.shouldHaveStartPlaybackButton): Don't allow inline controls during 
+            initial setup to prevent inline controls from begin drawn briefly when a media element
+            is created and inserted by a script called from a user gesture.
+        (ControllerIOS.prototype.updateWirelessPlaybackStatus): wirelessPlaybackStatus -&gt; inlinePlaybackPlaceholder.
+        (ControllerIOS.prototype.createControls): Ditto. Add style rules for optimized fullscreen button.
+        (ControllerIOS.prototype.configureInlineControls): Add the inlinePlaybackPlaceholder as a peer of
+            the inline controls compositing child instead of as a child so it renders correctly.
+        (ControllerIOS.prototype.addControls):
+        (ControllerIOS.prototype.updateControls): wirelessPlaybackStatus -&gt; inlinePlaybackPlaceholder.
+        (ControllerIOS.prototype.handleWrapperTouchStart):
+        (ControllerIOS.prototype.get pageScaleFactor): Cleanup.
+        (ControllerIOS.prototype.set pageScaleFactor): Ditto.
+        (ControllerIOS.prototype.handleFullscreenChange): Show the placeholder.
+
+        * WebCore.exp.in: Export _wkGetMediaUIImageData.
+
+        * html/HTMLMediaElement.h:
+        (WebCore::HTMLMediaElement::fullscreenMode): Expose fullscreen mode.
+
+        * platform/ios/WebCoreSystemInterfaceIOS.h:
+        * platform/ios/WebCoreSystemInterfaceIOS.mm:
+
</ins><span class="cx"> 2014-11-06  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Try to fix GTK build after r175719.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsMediaControlsHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -286,6 +286,50 @@
</span><span class="cx">     m_mediaElement-&gt;setMediaControlsDependOnPageScaleFactor(value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String MediaControlsHost::fullscreenMode() const
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(String, none, (ASCIILiteral(&quot;none&quot;)));
+    DEPRECATED_DEFINE_STATIC_LOCAL(String, standard, (ASCIILiteral(&quot;standard&quot;)));
+    DEPRECATED_DEFINE_STATIC_LOCAL(String, optimized, (ASCIILiteral(&quot;optimized&quot;)));
+    String mode = none;
+
+    enum VideoFullscreenMode { VideoFullscreenModeNone, VideoFullscreenModeStandard, VideoFullscreenModeOptimized };
+
+    switch (m_mediaElement-&gt;fullscreenMode()) {
+    case HTMLMediaElement::VideoFullscreenModeNone:
+        mode = none;
+        break;
+    case HTMLMediaElement::VideoFullscreenModeStandard:
+        mode = standard;
+        break;
+    case HTMLMediaElement::VideoFullscreenModeOptimized:
+        mode = optimized;
+        break;
+    }
+    
+    LOG(Media, &quot;MediaControlsHost::fullscreenMode - returning \&quot;%s\&quot;&quot;, mode.utf8().data());
+
+    return mode;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String MediaControlsHost::mediaUIImageData(const String&amp; partID) const
+{
+#if PLATFORM(IOS)
+    if (partID == &quot;optimized-fullscreen-button&quot;)
+        return wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenButton);
+
+    if (partID == &quot;optimized-fullscreen-button-hilited&quot;)
+        return wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenButtonHilited);
+
+    if (partID == &quot;optimized-fullscreen-placeholder&quot;)
+        return wkGetMediaUIImageData(wkMediaUIPartOptimizedFullscreenPlaceholder);
+#else
+    UNUSED_PARAM(partID);
</ins><span class="cx"> #endif
</span><ins>+
+    return emptyString();
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsMediaControlsHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -72,6 +72,8 @@
</span><span class="cx">     void exitedFullscreen();
</span><span class="cx">     void enterFullscreenOptimized();
</span><span class="cx">     bool optimizedFullscreenSupported();
</span><ins>+    String fullscreenMode() const;
+    String mediaUIImageData(const String&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     String externalDeviceDisplayName() const;
</span><span class="cx">     String externalDeviceType() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsMediaControlsHostidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -29,6 +29,18 @@
</span><span class="cx">     &quot;tvout&quot;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum FullscreenMode {
+    &quot;none&quot;,
+    &quot;standard&quot;,
+    &quot;optimized&quot;
+};
+
+enum MediaUIPartID {
+    &quot;optimized-fullscreen-button&quot;,
+    &quot;optimized-fullscreen-button-hilited&quot;,
+    &quot;optimized-fullscreen-placeholder&quot;
+};
+
</ins><span class="cx"> [
</span><span class="cx">     NoInterfaceObject,
</span><span class="cx">     Conditional=MEDIA_CONTROLS_SCRIPT,
</span><span class="lines">@@ -57,4 +69,6 @@
</span><span class="cx">     void exitedFullscreen();
</span><span class="cx">     void enterFullscreenOptimized();
</span><span class="cx">     readonly attribute boolean optimizedFullscreenSupported;
</span><ins>+    readonly attribute FullscreenMode fullscreenMode;
+    DOMString mediaUIImageData(MediaUIPartID partID);
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsmediaControlsiOScss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -66,9 +66,10 @@
</span><span class="cx">     -webkit-appearance: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-video::-webkit-media-controls-wireless-playback-status,
-audio::-webkit-media-controls-wireless-playback-status {
</del><ins>+video::-webkit-media-controls-inline-playback-placeholder,
+audio::-webkit-media-controls-inline-playback-placeholder {
</ins><span class="cx">     display: block;
</span><ins>+    z-index: 0;
</ins><span class="cx">     width: 100%;
</span><span class="cx">     height: 100%;
</span><span class="cx">     background-color: black;
</span><span class="lines">@@ -77,8 +78,8 @@
</span><span class="cx">     background-size: 100% 50%;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-video::-webkit-media-controls-wireless-playback-status.hidden,
-audio::-webkit-media-controls-wireless-playback-status.hidden {
</del><ins>+video::-webkit-media-controls-inline-playback-placeholder.hidden,
+audio::-webkit-media-controls-inline-playback-placeholder.hidden {
</ins><span class="cx">     display: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -246,9 +247,7 @@
</span><span class="cx"> video::-webkit-media-controls-optimized-fullscreen-button {
</span><span class="cx">     width: 35px;
</span><span class="cx">     height: 44px;
</span><del>-    background-size: 35px 44px;
-    opacity: 0.9;
-    background-image: url('data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 35 44&quot;&gt;&lt;g stroke=&quot;rgba(0, 0, 0, 0.4)&quot; fill=&quot;none&quot;&gt;&lt;path d=&quot;M 10,15 h 14 v 14 h -14 v -14&quot;/&gt;&lt;/g&gt;&lt;/svg&gt;');
</del><ins>+    opacity: 0.4;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> video::-webkit-media-controls-play-button {
</span><span class="lines">@@ -271,10 +270,6 @@
</span><span class="cx">     background-image: url('data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 35 44&quot;&gt;&lt;g stroke=&quot;white&quot; fill=&quot;none&quot;&gt;&lt;path d=&quot;M 10,20 v -5 h 5 M 10,15 l 5,5&quot;/&gt;&lt;path d=&quot;M 24,24 v 5 h -5 M 24,29 l -5,-5&quot;/&gt;&lt;/g&gt;&lt;/svg&gt;');
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-video::-webkit-media-controls-optimized-fullscreen-button:active {
-    background-image: url('data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 35 44&quot;&gt;&lt;g stroke=&quot;white&quot; fill=&quot;none&quot;&gt;&lt;path d=&quot;M 10,15 h 14 v 14 h -14 v -14&quot;/&gt;&lt;/g&gt;&lt;/svg&gt;');
-}
-
</del><span class="cx"> video::-webkit-media-controls-timeline,
</span><span class="cx"> audio::-webkit-media-controls-timeline {
</span><span class="cx">     -webkit-appearance: none;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsmediaControlsiOSjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> function ControllerIOS(root, video, host)
</span><span class="cx"> {
</span><ins>+    this.doingSetup = true;
</ins><span class="cx">     this.hasWirelessPlaybackTargets = false;
</span><span class="cx">     this._pageScaleFactor = 1;
</span><span class="cx">     this.isListeningForPlaybackTargetAvailabilityEvent = false;
</span><span class="lines">@@ -15,6 +16,7 @@
</span><span class="cx">     this.setNeedsTimelineMetricsUpdate();
</span><span class="cx"> 
</span><span class="cx">     host.controlsDependOnPageScaleFactor = true;
</span><ins>+    this.doingSetup = false;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /* Enums */
</span><span class="lines">@@ -76,7 +78,7 @@
</span><span class="cx">         if (this.video.currentSrc &amp;&amp; this.video.error)
</span><span class="cx">             return true;
</span><span class="cx"> 
</span><del>-        if (!this.host.userGestureRequired &amp;&amp; allowsInline)
</del><ins>+        if (!this.doingSetup &amp;&amp; !this.host.userGestureRequired &amp;&amp; allowsInline)
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         return true;
</span><span class="lines">@@ -115,13 +117,13 @@
</span><span class="cx">             backgroundImageSVG = backgroundImageSVG.replace('##DEVICE_TYPE##', deviceType);
</span><span class="cx">             backgroundImageSVG = backgroundImageSVG.replace('##DEVICE_NAME##', deviceName);
</span><span class="cx"> 
</span><del>-            this.controls.wirelessPlaybackStatus.style.backgroundImage = backgroundImageSVG;
-            this.controls.wirelessPlaybackStatus.setAttribute('aria-label', deviceType + &quot;, &quot; + deviceName);
</del><ins>+            this.controls.inlinePlaybackPlaceholder.style.backgroundImage = backgroundImageSVG;
+            this.controls.inlinePlaybackPlaceholder.setAttribute('aria-label', deviceType + &quot;, &quot; + deviceName);
</ins><span class="cx"> 
</span><del>-            this.controls.wirelessPlaybackStatus.classList.remove(this.ClassNames.hidden);
</del><ins>+            this.controls.inlinePlaybackPlaceholder.classList.remove(this.ClassNames.hidden);
</ins><span class="cx">             this.controls.wirelessTargetPicker.classList.add(this.ClassNames.active);
</span><span class="cx">         } else {
</span><del>-            this.controls.wirelessPlaybackStatus.classList.add(this.ClassNames.hidden);
</del><ins>+            this.controls.inlinePlaybackPlaceholder.classList.add(this.ClassNames.hidden);
</ins><span class="cx">             this.controls.wirelessTargetPicker.classList.remove(this.ClassNames.active);
</span><span class="cx">         }
</span><span class="cx">     },
</span><span class="lines">@@ -139,11 +141,17 @@
</span><span class="cx">         var panelCompositedParent = this.controls.panelCompositedParent = document.createElement('div');
</span><span class="cx">         panelCompositedParent.setAttribute('pseudo', '-webkit-media-controls-panel-composited-parent');
</span><span class="cx"> 
</span><ins>+        var inlinePlaybackPlaceholder = this.controls.inlinePlaybackPlaceholder = document.createElement('div');
+        inlinePlaybackPlaceholder.setAttribute('pseudo', '-webkit-media-controls-inline-playback-placeholder');
+        inlinePlaybackPlaceholder.classList.add(this.ClassNames.hidden);
+        inlinePlaybackPlaceholder.setAttribute('aria-label', this.UIString('Display Optimized Full Screen'));
</ins><span class="cx"> 
</span><del>-        var wirelessPlaybackStatus = this.controls.wirelessPlaybackStatus = document.createElement('div');
-        wirelessPlaybackStatus.setAttribute('pseudo', '-webkit-media-controls-wireless-playback-status');
-        wirelessPlaybackStatus.classList.add(this.ClassNames.hidden);
</del><ins>+        var buttonImageSVG = &quot;background-image: url('&quot; + this.host.mediaUIImageData(&quot;optimized-fullscreen-button&quot;) + &quot;')&quot;;
+        document.styleSheets[0].insertRule('video::-webkit-media-controls-optimized-fullscreen-button { ' + buttonImageSVG + '; }', 0);
</ins><span class="cx"> 
</span><ins>+        buttonImageSVG = &quot;background-image: url('&quot; + this.host.mediaUIImageData(&quot;optimized-fullscreen-button-hilited&quot;) + &quot;')&quot;;
+        document.styleSheets[0].insertRule('video::-webkit-media-controls-optimized-fullscreen-button:active { ' + buttonImageSVG + '; }', 0);
+
</ins><span class="cx">         var wirelessTargetPicker = this.controls.wirelessTargetPicker = document.createElement('button');
</span><span class="cx">         wirelessTargetPicker.setAttribute('pseudo', '-webkit-media-controls-wireless-playback-picker-button');
</span><span class="cx">         wirelessTargetPicker.setAttribute('aria-label', this.UIString('Choose Wireless Display'));
</span><span class="lines">@@ -196,8 +204,6 @@
</span><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     configureInlineControls: function() {
</span><del>-        this.base.appendChild(this.controls.wirelessPlaybackStatus);
-
</del><span class="cx">         this.controls.panel.appendChild(this.controls.playButton);
</span><span class="cx">         this.controls.panel.appendChild(this.controls.statusDisplay);
</span><span class="cx">         this.controls.panel.appendChild(this.controls.timelineBox);
</span><span class="lines">@@ -229,6 +235,7 @@
</span><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     addControls: function() {
</span><ins>+        this.base.appendChild(this.controls.inlinePlaybackPlaceholder);
</ins><span class="cx">         this.base.appendChild(this.controls.panelCompositedParent);
</span><span class="cx">         this.controls.panelCompositedParent.appendChild(this.controls.panel);
</span><span class="cx">         this.setNeedsTimelineMetricsUpdate();
</span><span class="lines">@@ -237,7 +244,7 @@
</span><span class="cx">     updateControls: function() {
</span><span class="cx">         if (this.shouldHaveStartPlaybackButton())
</span><span class="cx">             this.setControlsType(ControllerIOS.StartPlaybackControls);
</span><del>-        else if (this.isFullScreen())
</del><ins>+        else if (this.isFullScreen() &amp;&amp; this.host.fullscreenMode !== &quot;optimized&quot;)
</ins><span class="cx">             this.setControlsType(Controller.FullScreenControls);
</span><span class="cx">         else
</span><span class="cx">             this.setControlsType(Controller.InlineControls);
</span><span class="lines">@@ -355,7 +362,7 @@
</span><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     handleWrapperTouchStart: function(event) {
</span><del>-        if (event.target != this.base &amp;&amp; event.target != this.controls.wirelessPlaybackStatus)
</del><ins>+        if (event.target != this.base &amp;&amp; event.target != this.controls.inlinePlaybackPlaceholder)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         this.mostRecentNumberOfTargettedTouches = event.targetTouches.length;
</span><span class="lines">@@ -555,11 +562,13 @@
</span><span class="cx">         }
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    get pageScaleFactor() {
</del><ins>+    get pageScaleFactor()
+    {
</ins><span class="cx">         return this._pageScaleFactor;
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    set pageScaleFactor(newScaleFactor) {
</del><ins>+    set pageScaleFactor(newScaleFactor)
+    {
</ins><span class="cx">         if (this._pageScaleFactor === newScaleFactor)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="lines">@@ -580,7 +589,25 @@
</span><span class="cx">                 this.updateProgress();
</span><span class="cx">             }
</span><span class="cx">         }
</span><del>-    }
</del><ins>+    },
+
+    handleFullscreenChange: function(event)
+    {
+        Controller.prototype.handleFullscreenChange.call(this, event);
+
+        if (!this.isFullScreen()) {
+            this.controls.inlinePlaybackPlaceholder.classList.add(this.ClassNames.hidden);
+        } else if (this.host.fullscreenMode === &quot;optimized&quot;) {
+            var backgroundImageSVG = &quot;url('&quot; + this.host.mediaUIImageData(&quot;optimized-fullscreen-placeholder&quot;) + &quot;')&quot;;
+            this.controls.inlinePlaybackPlaceholder.style.backgroundImage = backgroundImageSVG;
+            this.controls.inlinePlaybackPlaceholder.setAttribute('aria-label', &quot;video playback placeholder&quot;);
+
+            this.controls.inlinePlaybackPlaceholder.classList.remove(this.ClassNames.hidden);
+        }
+
+        this.updateCaptionContainer();
+    },
+
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> Object.create(Controller.prototype).extend(ControllerIOS.prototype);
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -2845,6 +2845,7 @@
</span><span class="cx"> _wkGetAvailableScreenSize
</span><span class="cx"> _wkGetDeviceClass
</span><span class="cx"> _wkGetDeviceName
</span><ins>+_wkGetMediaUIImageData
</ins><span class="cx"> _wkGetOSNameForUserAgent
</span><span class="cx"> _wkGetPlatformNameForNavigator
</span><span class="cx"> _wkGetScreenScaleFactor
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -392,6 +392,8 @@
</span><span class="cx">     WEBCORE_EXPORT virtual bool isFullscreen() const override;
</span><span class="cx">     void toggleFullscreenState();
</span><span class="cx">     enum VideoFullscreenMode { VideoFullscreenModeNone, VideoFullscreenModeStandard, VideoFullscreenModeOptimized };
</span><ins>+    VideoFullscreenMode fullscreenMode() const { return m_videoFullscreenMode; }
+
</ins><span class="cx">     void enterFullscreen(VideoFullscreenMode);
</span><span class="cx">     virtual void enterFullscreen() override;
</span><span class="cx">     WEBCORE_EXPORT void exitFullscreen();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebCoreSystemInterfaceIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -75,4 +75,12 @@
</span><span class="cx"> 
</span><span class="cx"> extern bool (*wkIsOptimizedFullscreenSupported)(void);
</span><span class="cx"> 
</span><ins>+typedef enum {
+    wkMediaUIPartOptimizedFullscreenButton = 0,
+    wkMediaUIPartOptimizedFullscreenButtonHilited,
+    wkMediaUIPartOptimizedFullscreenPlaceholder
+} wkMediaUIPart;
+extern CFStringRef (*wkGetMediaUIImageData)(int wkMediaUIPart);
+
+
</ins><span class="cx"> #endif // WebCoreSystemInterfaceIOS_h
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebCoreSystemInterfaceIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -131,6 +131,7 @@
</span><span class="cx"> WEBCORE_EXPORT CFStringRef (*wkGetVendorNameForNavigator)(void);
</span><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT bool (*wkIsOptimizedFullscreenSupported)(void);
</span><ins>+WEBCORE_EXPORT CFStringRef (*wkGetMediaUIImageData)(int);
</ins><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT int (*wkExernalDeviceTypeForPlayer)(AVPlayer *);
</span><span class="cx"> WEBCORE_EXPORT NSString *(*wkExernalDeviceDisplayNameForPlayer)(AVPlayer *);
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-11-07  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        [iOS] Update optimized fullscreen media controls
+        https://bugs.webkit.org/show_bug.cgi?id=138493
+
+        Reviewed by Brent Fulgham.
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Initialize GetMediaUIImageData.
+
</ins><span class="cx"> 2014-11-06  Daniel Jalkut  &lt;jalkut@red-sweater.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Wrap the bulk of -[WebView dealloc] with an autorelease pool.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebSystemInterfacemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -132,6 +132,7 @@
</span><span class="cx">     INIT(GetScreenScaleFactor);
</span><span class="cx">     INIT(IsGB18030ComplianceRequired);
</span><span class="cx">     INIT(IsOptimizedFullscreenSupported);
</span><ins>+    INIT(GetMediaUIImageData);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     INIT(CreateCTLineWithUniCharProvider);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebKit2/ChangeLog        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-11-07  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        [iOS] Update optimized fullscreen media controls
+        https://bugs.webkit.org/show_bug.cgi?id=138493
+
+        Reviewed by Brent Fulgham.
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Initialize GetMediaUIImageData.
+
</ins><span class="cx"> 2014-11-07  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add cache coders
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebSystemInterfacemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm (175749 => 175750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm        2014-11-07 11:43:47 UTC (rev 175749)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm        2014-11-07 18:10:54 UTC (rev 175750)
</span><span class="lines">@@ -208,6 +208,7 @@
</span><span class="cx">         INIT(GetScreenScaleFactor);
</span><span class="cx">         INIT(IsGB18030ComplianceRequired);
</span><span class="cx">         INIT(IsOptimizedFullscreenSupported);
</span><ins>+        INIT(GetMediaUIImageData);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(PUBLIC_SUFFIX_LIST)
</span></span></pre>
</div>
</div>

</body>
</html>