<!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>[164223] trunk/Source/WebCore</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/164223">164223</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2014-02-17 09:17:23 -0800 (Mon, 17 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[MediaControls][iOS] Make mediacontrols match the system inline controls
https://bugs.webkit.org/show_bug.cgi?id=128833

Reviewed by Eric Carlson.

Move items slightly, fix button sizes, font sizes, and colors to match the
inline controls from MoviePlayer.framework.

* Modules/mediacontrols/mediaControlsiOS.css:
(audio::-webkit-media-controls-panel):
(audio::-webkit-media-controls-fullscreen-button):
(audio::-webkit-media-controls-play-button):
(audio::-webkit-media-controls-play-button.paused):
(audio::-webkit-media-controls-timeline):
(audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
(audio::-webkit-media-controls-time-remaining-display):
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.configureInlineControls): Do not add the status text.
(ControllerIOS.prototype.updateTime): Call updateProgress().
(ControllerIOS.prototype.progressFillStyle): Draw a slightly different color.
(ControllerIOS.prototype.updateProgress): Draw white to the left of the currentTime.
(ControllerIOS.prototype.formatTime): Single leading zero in the time display fields.
(ControllerIOS.prototype.handleTimelineChange): Call updateProgress().</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164222 => 164223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-17 16:18:14 UTC (rev 164222)
+++ trunk/Source/WebCore/ChangeLog        2014-02-17 17:17:23 UTC (rev 164223)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-02-17  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        [MediaControls][iOS] Make mediacontrols match the system inline controls
+        https://bugs.webkit.org/show_bug.cgi?id=128833
+
+        Reviewed by Eric Carlson.
+
+        Move items slightly, fix button sizes, font sizes, and colors to match the
+        inline controls from MoviePlayer.framework.
+
+        * Modules/mediacontrols/mediaControlsiOS.css:
+        (audio::-webkit-media-controls-panel):
+        (audio::-webkit-media-controls-fullscreen-button):
+        (audio::-webkit-media-controls-play-button):
+        (audio::-webkit-media-controls-play-button.paused):
+        (audio::-webkit-media-controls-timeline):
+        (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
+        (audio::-webkit-media-controls-time-remaining-display):
+        * Modules/mediacontrols/mediaControlsiOS.js:
+        (ControllerIOS.prototype.configureInlineControls): Do not add the status text.
+        (ControllerIOS.prototype.updateTime): Call updateProgress().
+        (ControllerIOS.prototype.progressFillStyle): Draw a slightly different color.
+        (ControllerIOS.prototype.updateProgress): Draw white to the left of the currentTime.
+        (ControllerIOS.prototype.formatTime): Single leading zero in the time display fields.
+        (ControllerIOS.prototype.handleTimelineChange): Call updateProgress().
+
</ins><span class="cx"> 2014-02-17  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Grid Layout] Fix missing layout in flexible and content sized columns
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsmediaControlsiOScss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css (164222 => 164223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css        2014-02-17 16:18:14 UTC (rev 164222)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.css        2014-02-17 17:17:23 UTC (rev 164223)
</span><span class="lines">@@ -67,11 +67,11 @@
</span><span class="cx">     position: relative;
</span><span class="cx">     bottom: 0;
</span><span class="cx">     width: 100%;
</span><del>-    padding-top: 1px;
</del><ins>+    padding-bottom: 1px;
</ins><span class="cx">     height: 44px;
</span><span class="cx">     line-height: 44px;
</span><span class="cx">     -webkit-user-select: none;
</span><del>-    background-color: rgba(255, 255, 255, .5);
</del><ins>+    background-color: rgba(245, 245, 245, .75);
</ins><span class="cx"> 
</span><span class="cx">     display: -webkit-flex;
</span><span class="cx">     -webkit-flex-direction: row;
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx">     display: block;
</span><span class="cx">     padding: 0;
</span><span class="cx">     border: 0;
</span><del>-    background-color: black;
</del><ins>+    background-color: rgba(0, 0, 0, .5);
</ins><span class="cx">     -webkit-mask-origin: content-box;
</span><span class="cx">     -webkit-mask-repeat: no-repeat;
</span><span class="cx">     -webkit-mask-size: contain;
</span><span class="lines">@@ -153,24 +153,25 @@
</span><span class="cx"> video::-webkit-media-controls-play-button,
</span><span class="cx"> audio::-webkit-media-controls-play-button {
</span><span class="cx">     margin-left: 34px;
</span><del>-    margin-right: 13px;
-    width: 19px;
-    height: 17px;
-    -webkit-mask-image: url('data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 18 16&quot;&gt;&lt;rect x=&quot;1&quot; y=&quot;0&quot; width=&quot;5&quot; height=&quot;16&quot; fill=&quot;white&quot;/&gt;&lt;rect x=&quot;12&quot; y=&quot;0&quot; width=&quot;5&quot; height=&quot;16&quot; fill=&quot;white&quot;/&gt;&lt;/svg&gt;');
</del><ins>+    margin-right: 15px;
+    margin-top: 1px;
+    width: 21px;
+    height: 23px;
+    -webkit-mask-image: url('data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;21&quot; height=&quot;22&quot;&gt;&lt;rect x=&quot;1&quot; y=&quot;0&quot; width=&quot;6&quot; height=&quot;22&quot; fill=&quot;white&quot;/&gt;&lt;rect x=&quot;13&quot; y=&quot;0&quot; width=&quot;6&quot; height=&quot;22&quot; fill=&quot;white&quot;/&gt;&lt;/svg&gt;');
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> video::-webkit-media-controls-play-button.paused,
</span><span class="cx"> audio::-webkit-media-controls-play-button.paused {
</span><del>-    -webkit-mask-image: url('data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 18 16&quot;&gt;&lt;path d=&quot;M 0,0 18,8 0,16 z&quot; fill=&quot;white&quot;/&gt;&lt;/svg&gt;');
</del><ins>+    -webkit-mask-image: url('data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;21&quot; height=&quot;23&quot;&gt;&lt;path d=&quot;M 0,0.25 21,10.5 0,21.75 z&quot; fill=&quot;white&quot;/&gt;&lt;/svg&gt;');
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> video::-webkit-media-controls-fullscreen-button,
</span><span class="cx"> audio::-webkit-media-controls-fullscreen-button {
</span><span class="cx">     margin-right: 34px;
</span><span class="cx">     margin-left: 13px;
</span><del>-    width: 17px;
-    height: 17px;
-    -webkit-mask-image: url('data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 16 16&quot; width=&quot;16px&quot; height=&quot;16px&quot;&gt;&lt;g stroke=&quot;white&quot; fill=&quot;transparent&quot;&gt;&lt;path d=&quot;M .5,5 v -4.5 h 4.5M .5,.5 l 5.5,5.5&quot; /&gt; &lt;path d=&quot;M 15.5,11 v 4.5 h -4.5 M 15.5,15.5 l -5.5,-5.5&quot; /&gt;&lt;/g&gt;&lt;/svg&gt;')
</del><ins>+    width: 15px;
+    height: 15px;
+    -webkit-mask-image: url('data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;15px&quot; height=&quot;15px&quot;&gt;&lt;g stroke=&quot;white&quot; fill=&quot;transparent&quot;&gt;&lt;path d=&quot;M .5,5 v -4.5 h 4.5M .5,.5 l 5.5,5.5&quot; /&gt; &lt;path d=&quot;M 14.5,10 v 4.5 h -4.5 M 14.5,14.5 l -5.5,-5.5&quot; /&gt;&lt;/g&gt;&lt;/svg&gt;');
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /* Retina images */
</span><span class="lines">@@ -189,19 +190,18 @@
</span><span class="cx">     margin: 0;
</span><span class="cx"> 
</span><span class="cx">     border-radius: 1.5px;
</span><del>-    background-color: black;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> video::-webkit-media-controls-timeline::-webkit-slider-thumb,
</span><span class="cx"> audio::-webkit-media-controls-timeline::-webkit-slider-thumb {
</span><span class="cx">     -webkit-appearance: none;
</span><del>-    width: 15px;
-    height: 15px;
</del><ins>+    width: 16px;
+    height: 16px;
</ins><span class="cx">     border: 0;
</span><del>-    border-radius: 7.5px;
-    background-color: white !important;
-    color: white;
-    box-shadow: 0 0 1px rgba(0, 0, 0, .5);
</del><ins>+    border-radius: 8px;
+    background-image: url('data:image/svg+xml,&lt;svg width=&quot;16&quot; height=&quot;16&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;circle r=&quot;7.75&quot; cy=&quot;8&quot; cx=&quot;8&quot; fill=&quot;white&quot; stroke=&quot;rgba(0, 0, 0, .25)&quot; stroke-width=&quot;.5&quot;/&gt;&lt;/svg&gt;');
+    background-color: transparent !important;
+    box-shadow: 0 3px 1px -1px rgba(0, 0, 0, .15);
</ins><span class="cx"> 
</span><span class="cx">     /* rotateZ() forces the layer into compositing mode. Slider 
</span><span class="cx">        thumbs are small, so forcing a compositing layer is inexpensive,
</span><span class="lines">@@ -219,12 +219,12 @@
</span><span class="cx">     -webkit-justify-content: center;
</span><span class="cx">     -webkit-align-items: center;
</span><span class="cx">     cursor: default;
</span><del>-    font-size: 10px;
</del><ins>+    font-size: 13px;
</ins><span class="cx">     overflow-y: hidden;
</span><span class="cx">     overflow-x: hidden;
</span><del>-    width: 45px;
-    min-width: 45px;
-    color: black;
</del><ins>+    width: 44px;
+    min-width: 44px;
+    color: rgba(0, 0, 0, .5);
</ins><span class="cx">     letter-spacing: normal;
</span><span class="cx">     word-spacing: normal;
</span><span class="cx">     line-height: normal;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsmediaControlsiOSjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (164222 => 164223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js        2014-02-17 16:18:14 UTC (rev 164222)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js        2014-02-17 17:17:23 UTC (rev 164223)
</span><span class="lines">@@ -119,7 +119,6 @@
</span><span class="cx"> 
</span><span class="cx">     configureInlineControls: function() {
</span><span class="cx">         this.controls.panel.appendChild(this.controls.playButton);
</span><del>-        this.controls.panel.appendChild(this.controls.statusDisplay);
</del><span class="cx">         this.controls.panel.appendChild(this.controls.timelineBox);
</span><span class="cx">         this.controls.timelineBox.appendChild(this.controls.currentTime);
</span><span class="cx">         this.controls.timelineBox.appendChild(this.controls.timeline);
</span><span class="lines">@@ -142,10 +141,47 @@
</span><span class="cx"> 
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    updateTime: function() {
+        Controller.prototype.updateTime.call(this);
+        this.updateProgress();
+    },
+
</ins><span class="cx">     progressFillStyle: function() {
</span><del>-        return 'rgb(0, 0, 0)';
</del><ins>+        return 'rgba(0, 0, 0, 0.5)';
</ins><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    updateProgress: function()
+    {
+        Controller.prototype.updateProgress.call(this);
+
+        var width = this.controls.timeline.offsetWidth;
+        var height = this.controls.timeline.offsetHeight;
+
+        // Magic number, matching the value for ::-webkit-media-controls-timeline::-webkit-slider-thumb
+        // in mediaControlsiOS.css. Since we cannot ask the thumb for its offsetWidth as it's in its own
+        // shadow dom, just hard-code the value.
+        var thumbWidth = 16;
+        var endX = thumbWidth / 2 + (width - thumbWidth) * this.video.currentTime / this.video.duration;
+
+        var context = document.getCSSCanvasContext('2d', 'timeline-' + this.timelineID, width, height);
+        context.fillStyle = 'white';
+        context.fillRect(0, 0, endX, height);
+    },
+
+    formatTime: function(time) {
+        if (isNaN(time))
+            time = 0;
+        var absTime = Math.abs(time);
+        var intSeconds = Math.floor(absTime % 60).toFixed(0);
+        var intMinutes = Math.floor(absTime / 60).toFixed(0);
+        return (time &lt; 0 ? '-' : String()) + String('0' + intMinutes).slice(-1) + &quot;:&quot; + String('00' + intSeconds).slice(-2)
+    },
+
+    handleTimelineChange: function(event) {
+        Controller.prototype.handleTimelineChange.call(this);
+        this.updateProgress();
+    },
+
</ins><span class="cx">     handlePlayButtonTouchStart: function() {
</span><span class="cx">         this.controls.playButton.classList.add('active');
</span><span class="cx">     },
</span></span></pre>
</div>
</div>

</body>
</html>