<!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>[203151] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/203151">203151</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2016-07-12 21:50:14 -0700 (Tue, 12 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/202509">r202509</a>): media controls controls enabled AirPlay placeholder is shown
https://bugs.webkit.org/show_bug.cgi?id=159685
<rdar://problem/27198899>
Reviewed by Dean Jackson.
Source/WebCore:
Test: media/controls/airplay-controls.html
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.shouldShowControls): Split some of the logic out of shouldHaveControls.
(Controller.prototype.shouldHaveControls): Having controls != showing controls.
(Controller.prototype.updateControls): Call shouldShowControls, not shouldHaveControls.
(Controller.prototype.updateWirelessPlaybackStatus): Add 'appletv' to the class when active.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus): Call ensureMediaControlsShadowRoot
in case the controls haven't been created yet.
LayoutTests:
* media/controls/airplay-controls-expected.txt: Added.
* media/controls/airplay-controls.html: Added.
* media/controls/controls-test-helpers.js:
(ControlsTest.prototype.get currentState): Put a try block around the call to get the current
status in case it fails.
* platform/mac/TestExpectations: Skip the new test on Yosemite where AirPlay doesn't work.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediacontrolscontrolstesthelpersjs">trunk/LayoutTests/media/controls/controls-test-helpers.js</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsmediaControlsApplejs">trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediacontrolsairplaycontrolsexpectedtxt">trunk/LayoutTests/media/controls/airplay-controls-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediacontrolsairplaycontrolshtml">trunk/LayoutTests/media/controls/airplay-controls.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203150 => 203151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-13 04:47:00 UTC (rev 203150)
+++ trunk/LayoutTests/ChangeLog        2016-07-13 04:50:14 UTC (rev 203151)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-07-12 Eric Carlson <eric.carlson@apple.com>
+
+ REGRESSION (r202509): media controls controls enabled AirPlay placeholder is shown
+ https://bugs.webkit.org/show_bug.cgi?id=159685
+ <rdar://problem/27198899>
+
+ Reviewed by Dean Jackson.
+
+ * media/controls/airplay-controls-expected.txt: Added.
+ * media/controls/airplay-controls.html: Added.
+
+ * media/controls/controls-test-helpers.js:
+ (ControlsTest.prototype.get currentState): Put a try block around the call to get the current
+ status in case it fails.
+
+ * platform/mac/TestExpectations: Skip the new test on Yosemite where AirPlay doesn't work.
+
</ins><span class="cx"> 2016-07-12 Benjamin Poulain <bpoulain@apple.com>
</span><span class="cx">
</span><span class="cx"> [JSC] Array.prototype.join() fails some conformance tests
</span></span></pre></div>
<a id="trunkLayoutTestsmediacontrolsairplaycontrolsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/controls/airplay-controls-expected.txt (0 => 203151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/controls/airplay-controls-expected.txt         (rev 0)
+++ trunk/LayoutTests/media/controls/airplay-controls-expected.txt        2016-07-13 04:50:14 UTC (rev 203151)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+This tests that showing the wireless device placeholder does not show controls.
+
+This test only runs in DRT!
+
+
+EVENT: canplaythrough
+
+Test initial state
+
+PASS: We are using the apple idiom
+PASS: video.controls should be false
+PASS: Controls should not be visible
+
+Select an AppleTV device
+
+PASS: Placeholder is visible
+PASS: Placeholder has classname 'appletv'
+PASS: Controls should not be visible
+
+Testing finished.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediacontrolsairplaycontrolshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/controls/airplay-controls.html (0 => 203151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/controls/airplay-controls.html         (rev 0)
+++ trunk/LayoutTests/media/controls/airplay-controls.html        2016-07-13 04:50:14 UTC (rev 203151)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../media-file.js"></script>
+ <script src="controls-test-helpers.js"></script>
+ <script>
+ internals.setMockMediaPlaybackTargetPickerEnabled(true);
+ internals.settings.setAllowsAirPlayForMediaPlayback(true);
+
+ let eventCounter = 0;
+
+ function isVisible(state)
+ {
+ if (state === null || typeof state.className !== "string")
+ return true;
+
+ const classes = state.className.split();
+ return !classes.includes("dropped") && !classes.includes("hidden");
+ }
+
+ function start()
+ {
+ tester.startNewSection("Test initial state");
+
+ tester.test("We are using the apple idiom")
+ .value(tester.currentState.idiom)
+ .isEqualTo("apple");
+
+ tester.test("video.controls should be false")
+ .value(tester.media.controls)
+ .isFalse();
+
+ const controlPanel = tester.stateForControlsElement("Media Controls Panel");
+ tester.test("Controls should not be visible")
+ .value(isVisible(controlPanel))
+ .isFalse();
+
+ tester.startNewSection("Select an AppleTV device");
+ internals.setMediaElementRestrictions(tester.media, "norestrictions");
+ tester.media.addEventListener('webkitplaybacktargetavailabilitychanged', () => { }, false);
+ tester.media.addEventListener('webkitcurrentplaybacktargetiswirelesschanged', targetChanged, false);
+ internals.setMockMediaPlaybackTargetPickerState("Sleepy TV", "DeviceAvailable");
+ }
+
+ function targetChanged()
+ {
+ if (!tester.media.webkitCurrentPlaybackTargetIsWireless)
+ return;
+
+ // Because this script is triggered by the same event the default controls use to
+ // show the placeholder, this may run before the controls have been reconfigured.
+ const placeholder = tester.stateForControlsElement("Inline playback placeholder", true);
+ if (!isVisible(placeholder) && ++eventCounter < 5) {
+ setTimeout(targetChanged, 100);
+ return;
+ }
+
+ tester.test("Placeholder is visible")
+ .value(isVisible(placeholder))
+ .isTrue();
+ tester.test("Placeholder has classname 'appletv'")
+ .value(placeholder.className)
+ .contains("appletv");
+
+ const controlPanel = tester.stateForControlsElement("Media Controls Panel");
+ tester.test("Controls should not be visible")
+ .value(isVisible(controlPanel))
+ .isFalse();
+
+ tester.end();
+ }
+
+ const tester = new ControlsTest()
+ .whenReady(start)
+ .start();
+
+ </script>
+ </head>
+ <body>
+ <p>This tests that showing the wireless device placeholder does not show controls.</p>
+ <p>This test only runs in DRT!</p>
+ <video ></video>
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsmediacontrolscontrolstesthelpersjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/controls/controls-test-helpers.js (203150 => 203151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/controls/controls-test-helpers.js        2016-07-13 04:47:00 UTC (rev 203150)
+++ trunk/LayoutTests/media/controls/controls-test-helpers.js        2016-07-13 04:50:14 UTC (rev 203151)
</span><span class="lines">@@ -40,7 +40,11 @@
</span><span class="cx"> return null;
</span><span class="cx">
</span><span class="cx"> if (window.internals) {
</span><del>- this.cachedCurrentState = JSON.parse(internals.getCurrentMediaControlsStatusForElement(this.media));
</del><ins>+ let state = { idiom: "apple", status: "fail" };
+ try {
+ state = JSON.parse(internals.getCurrentMediaControlsStatusForElement(this.media));
+ } catch(e) { }
+ this.cachedCurrentState = state;
</ins><span class="cx"> return this.cachedCurrentState;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (203150 => 203151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2016-07-13 04:47:00 UTC (rev 203150)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2016-07-13 04:50:14 UTC (rev 203151)
</span><span class="lines">@@ -1288,6 +1288,7 @@
</span><span class="cx"> [ Yosemite ] media/airplay-target-availability.html
</span><span class="cx"> [ Yosemite ] media/controls/airplay-picker.html
</span><span class="cx"> [ Yosemite ] media/airplay-autoplay.html
</span><ins>+[ Yosemite ] media/controls/airplay-controls.html
</ins><span class="cx">
</span><span class="cx"> webkit.org/b/153086 sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/15.1.3/15.1.3.3_encodeURI/S15.1.3.3_A2.4_T2.html [ Pass Crash ]
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203150 => 203151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-13 04:47:00 UTC (rev 203150)
+++ trunk/Source/WebCore/ChangeLog        2016-07-13 04:50:14 UTC (rev 203151)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-07-12 Eric Carlson <eric.carlson@apple.com>
+
+ REGRESSION (r202509): media controls controls enabled AirPlay placeholder is shown
+ https://bugs.webkit.org/show_bug.cgi?id=159685
+ <rdar://problem/27198899>
+
+ Reviewed by Dean Jackson.
+
+ Test: media/controls/airplay-controls.html
+
+ * Modules/mediacontrols/mediaControlsApple.js:
+ (Controller.prototype.shouldShowControls): Split some of the logic out of shouldHaveControls.
+ (Controller.prototype.shouldHaveControls): Having controls != showing controls.
+ (Controller.prototype.updateControls): Call shouldShowControls, not shouldHaveControls.
+ (Controller.prototype.updateWirelessPlaybackStatus): Add 'appletv' to the class when active.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus): Call ensureMediaControlsShadowRoot
+ in case the controls haven't been created yet.
+
</ins><span class="cx"> 2016-07-12 Frederic Wang <fwang@igalia.com>
</span><span class="cx">
</span><span class="cx"> Move parsing of mpadded attributes to a MathMLPaddedElement class
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsmediaControlsApplejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (203150 => 203151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js        2016-07-13 04:47:00 UTC (rev 203150)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js        2016-07-13 04:50:14 UTC (rev 203151)
</span><span class="lines">@@ -118,7 +118,8 @@
</span><span class="cx"> out: 'out',
</span><span class="cx"> pictureInPictureButton: 'picture-in-picture-button',
</span><span class="cx"> placeholderShowing: 'placeholder-showing',
</span><del>- usesLTRUserInterfaceLayoutDirection: 'uses-ltr-user-interface-layout-direction'
</del><ins>+ usesLTRUserInterfaceLayoutDirection: 'uses-ltr-user-interface-layout-direction',
+ appleTV: 'appletv',
</ins><span class="cx"> },
</span><span class="cx"> KeyCodes: {
</span><span class="cx"> enter: 13,
</span><span class="lines">@@ -301,16 +302,19 @@
</span><span class="cx"> return this.shouldHaveControls() || (this.video.textTracks && this.video.textTracks.length) || this.currentPlaybackTargetIsWireless();
</span><span class="cx"> },
</span><span class="cx">
</span><del>- shouldHaveControls: function()
</del><ins>+ shouldShowControls: function()
</ins><span class="cx"> {
</span><span class="cx"> if (!this.isAudio() && !this.host.allowsInlineMediaPlayback)
</span><span class="cx"> return true;
</span><span class="cx">
</span><del>- if (this.isFullScreen() || this.presentationMode() === 'picture-in-picture' || this.currentPlaybackTargetIsWireless())
- return true;
</del><ins>+ return this.video.controls || this.isFullScreen();
+ },
</ins><span class="cx">
</span><del>- return this.video.controls;
</del><ins>+ shouldHaveControls: function()
+ {
+ return this.shouldShowControls() || this.isFullScreen() || this.presentationMode() === 'picture-in-picture' || this.currentPlaybackTargetIsWireless();
</ins><span class="cx"> },
</span><ins>+
</ins><span class="cx">
</span><span class="cx"> setNeedsTimelineMetricsUpdate: function()
</span><span class="cx"> {
</span><span class="lines">@@ -670,7 +674,7 @@
</span><span class="cx"> this.updateLayoutForDisplayedWidth();
</span><span class="cx"> this.setNeedsTimelineMetricsUpdate();
</span><span class="cx">
</span><del>- if (this.shouldHaveControls()) {
</del><ins>+ if (this.shouldShowControls()) {
</ins><span class="cx"> this.controls.panel.classList.add(this.ClassNames.show);
</span><span class="cx"> this.controls.panel.classList.remove(this.ClassNames.hidden);
</span><span class="cx"> this.resetHideControlsTimer();
</span><span class="lines">@@ -2153,6 +2157,7 @@
</span><span class="cx"> this.controls.inlinePlaybackPlaceholderTextTop.innerText = deviceType;
</span><span class="cx"> this.controls.inlinePlaybackPlaceholderTextBottom.innerText = deviceName;
</span><span class="cx"> this.controls.inlinePlaybackPlaceholder.setAttribute('aria-label', deviceType + ", " + deviceName);
</span><ins>+ this.controls.inlinePlaybackPlaceholder.classList.add(this.ClassNames.appleTV);
</ins><span class="cx"> this.controls.inlinePlaybackPlaceholder.classList.remove(this.ClassNames.hidden);
</span><span class="cx"> this.controls.wirelessTargetPicker.classList.add(this.ClassNames.playing);
</span><span class="cx"> if (!this.isFullScreen() && (this.video.offsetWidth <= 250 || this.video.offsetHeight <= 200)) {
</span><span class="lines">@@ -2170,6 +2175,7 @@
</span><span class="cx"> this.showControls();
</span><span class="cx"> } else {
</span><span class="cx"> this.controls.inlinePlaybackPlaceholder.classList.add(this.ClassNames.hidden);
</span><ins>+ this.controls.inlinePlaybackPlaceholder.classList.remove(this.ClassNames.appleTV);
</ins><span class="cx"> this.controls.wirelessTargetPicker.classList.remove(this.ClassNames.playing);
</span><span class="cx"> this.controls.volumeBox.classList.remove(this.ClassNames.hidden);
</span><span class="cx"> this.controls.muteBox.classList.remove(this.ClassNames.hidden);
</span><span class="lines">@@ -2364,6 +2370,15 @@
</span><span class="cx"> name: "Inline playback placeholder",
</span><span class="cx"> object: this.controls.inlinePlaybackPlaceholder,
</span><span class="cx"> },
</span><ins>+ {
+ name: "Media Controls Panel",
+ object: this.controls.panel,
+ extraProperties: ["hidden"],
+ },
+ {
+ name: "Control Base Element",
+ object: this.base || null,
+ },
</ins><span class="cx"> ];
</span><span class="cx">
</span><span class="cx"> elements.forEach(function (element) {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (203150 => 203151)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-07-13 04:47:00 UTC (rev 203150)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-07-13 04:50:14 UTC (rev 203151)
</span><span class="lines">@@ -6704,6 +6704,8 @@
</span><span class="cx"> String HTMLMediaElement::getCurrentMediaControlsStatus()
</span><span class="cx"> {
</span><span class="cx"> DOMWrapperWorld& world = ensureIsolatedWorld();
</span><ins>+ ensureMediaControlsShadowRoot();
+
</ins><span class="cx"> ScriptController& scriptController = document().frame()->script();
</span><span class="cx"> JSDOMGlobalObject* globalObject = JSC::jsCast<JSDOMGlobalObject*>(scriptController.globalObject(world));
</span><span class="cx"> JSC::ExecState* exec = globalObject->globalExec();
</span></span></pre>
</div>
</div>
</body>
</html>