<!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>[277080] 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/277080">277080</a></dd>
<dt>Author</dt> <dd>philn@webkit.org</dd>
<dt>Date</dt> <dd>2021-05-06 04:11:39 -0700 (Thu, 06 May 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION(<a href="http://trac.webkit.org/projects/webkit/changeset/271341">r271341</a>): media/media-fullscreen-inline.html times out on GTK
https://bugs.webkit.org/show_bug.cgi?id=220540

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

When the GStreamer player client is an <audio> tag it won't render any video, but setting no
explicit video sink on playbin will not prevent video rendering per-se. In that situation
playbin will use autovideosink which will end-up creating a standalone window through
glimagesink or whatever has the highest rank. For now with playbin2 we can use fakevideosink
for such situation. For the playbin3 case we might be able to entirely deactivate video
rendering through stream selection.

Internals::isChangingPresentationMode was enabled for ports not implementing
VIDEO_PRESENTATION_MODE yet, because this test makes use of it.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
(WebCore::MediaPlayerPrivateGStreamer::createVideoSink):
* testing/Internals.cpp:
(WebCore::Internals::isChangingPresentationMode const):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Call webkitExitFullScreen() asynchronously to give time to the WebCore FullscreenManager to
notify the video element that it entered full-screen, and thus allowing the exitFullScreen()
call to go through.

* media/media-fullscreen.js:
(fullscreenchange):
(async beginfullscreen):
* platform/glib/TestExpectations:
* platform/glib/media/media-fullscreen-inline-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediamediafullscreenjs">trunk/LayoutTests/media/media-fullscreen.js</a></li>
<li><a href="#trunkLayoutTestsplatformglibTestExpectations">trunk/LayoutTests/platform/glib/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformglibmediamediafullscreeninlineexpectedtxt">trunk/LayoutTests/platform/glib/media/media-fullscreen-inline-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (277079 => 277080)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-05-06 10:55:52 UTC (rev 277079)
+++ trunk/LayoutTests/ChangeLog 2021-05-06 11:11:39 UTC (rev 277080)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2021-05-06  Philippe Normand  <pnormand@igalia.com>
+
+        REGRESSION(r271341): media/media-fullscreen-inline.html times out on GTK
+        https://bugs.webkit.org/show_bug.cgi?id=220540
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Call webkitExitFullScreen() asynchronously to give time to the WebCore FullscreenManager to
+        notify the video element that it entered full-screen, and thus allowing the exitFullScreen()
+        call to go through.
+
+        * media/media-fullscreen.js:
+        (fullscreenchange):
+        (async beginfullscreen):
+        * platform/glib/TestExpectations:
+        * platform/glib/media/media-fullscreen-inline-expected.txt:
+
</ins><span class="cx"> 2021-05-06  Tim Nguyen  <ntim@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Re-import css/css-color & css/css-color-adjust WPT
</span></span></pre></div>
<a id="trunkLayoutTestsmediamediafullscreenjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/media-fullscreen.js (277079 => 277080)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-fullscreen.js      2021-05-06 10:55:52 UTC (rev 277079)
+++ trunk/LayoutTests/media/media-fullscreen.js 2021-05-06 11:11:39 UTC (rev 277080)
</span><span class="lines">@@ -33,16 +33,23 @@
</span><span class="cx"> function fullscreenchange()
</span><span class="cx"> {
</span><span class="cx">     if (document.webkitIsFullScreen)
</span><del>-        beginfullscreen();
</del><ins>+        beginfullscreen(true);
</ins><span class="cx">     else
</span><span class="cx">         endfullscreen();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-async function beginfullscreen()
</del><ins>+async function beginfullscreen(wasTriggeredFromFullscreenChangeEvent)
</ins><span class="cx"> {
</span><span class="cx">     if (window.internals)
</span><span class="cx">         await testExpectedEventually("internals.isChangingPresentationMode(mediaElement)", false);
</span><del>-    run("mediaElement.webkitExitFullScreen()");
</del><ins>+    if (!wasTriggeredFromFullscreenChangeEvent)
+        run("mediaElement.webkitExitFullScreen()");
+    else {
+        // Call asynchronously to give time to the WebCore FullscreenManager to notify the video
+        // element that it entered full-screen, and thus allowing the exitFullScreen() call to go
+        // through.
+        setTimeout('run("mediaElement.webkitExitFullScreen()")', 0);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function endfullscreen()
</span></span></pre></div>
<a id="trunkLayoutTestsplatformglibTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/glib/TestExpectations (277079 => 277080)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/glib/TestExpectations 2021-05-06 10:55:52 UTC (rev 277079)
+++ trunk/LayoutTests/platform/glib/TestExpectations    2021-05-06 11:11:39 UTC (rev 277080)
</span><span class="lines">@@ -567,8 +567,6 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/173188 fast/mediastream/getUserMedia-grant-persistency3.html [ Pass Failure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/220540 media/media-fullscreen-inline.html [ Timeout ]
-
</del><span class="cx"> webkit.org/b/179258 fast/canvas/webgl/texImage2D-mse-flipY-false.html [ Timeout ]
</span><span class="cx"> webkit.org/b/179258 fast/canvas/webgl/texImage2D-mse-flipY-true.html [ Timeout ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformglibmediamediafullscreeninlineexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/glib/media/media-fullscreen-inline-expected.txt (277079 => 277080)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/glib/media/media-fullscreen-inline-expected.txt       2021-05-06 10:55:52 UTC (rev 277079)
+++ trunk/LayoutTests/platform/glib/media/media-fullscreen-inline-expected.txt  2021-05-06 11:11:39 UTC (rev 277080)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> * event handler triggered by user gesture
</span><span class="cx"> RUN(mediaElement.webkitEnterFullScreen())
</span><span class="cx"> EVENT(webkitfullscreenchange)
</span><del>-EXPECTED (mediaElement.webkitDisplayingFullscreen == 'true') OK
</del><ins>+EXPECTED (internals.isChangingPresentationMode(mediaElement) == 'false') OK
</ins><span class="cx"> RUN(mediaElement.webkitExitFullScreen())
</span><span class="cx"> EVENT(webkitfullscreenchange)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (277079 => 277080)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-05-06 10:55:52 UTC (rev 277079)
+++ trunk/Source/WebCore/ChangeLog      2021-05-06 11:11:39 UTC (rev 277080)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2021-05-06  Philippe Normand  <pnormand@igalia.com>
+
+        REGRESSION(r271341): media/media-fullscreen-inline.html times out on GTK
+        https://bugs.webkit.org/show_bug.cgi?id=220540
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        When the GStreamer player client is an <audio> tag it won't render any video, but setting no
+        explicit video sink on playbin will not prevent video rendering per-se. In that situation
+        playbin will use autovideosink which will end-up creating a standalone window through
+        glimagesink or whatever has the highest rank. For now with playbin2 we can use fakevideosink
+        for such situation. For the playbin3 case we might be able to entirely deactivate video
+        rendering through stream selection.
+
+        Internals::isChangingPresentationMode was enabled for ports not implementing
+        VIDEO_PRESENTATION_MODE yet, because this test makes use of it.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
+        (WebCore::MediaPlayerPrivateGStreamer::createVideoSink):
+        * testing/Internals.cpp:
+        (WebCore::Internals::isChangingPresentationMode const):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2021-05-06  Ryosuke Niwa  <rniwa@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Replace raw pointers in SVGElementRareData and SVGDocumentExtensions with WeakHashMap and WeakPtr
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (277079 => 277080)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2021-05-06 10:55:52 UTC (rev 277079)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp    2021-05-06 11:11:39 UTC (rev 277080)
</span><span class="lines">@@ -2776,9 +2776,7 @@
</span><span class="cx">     if (!m_audioSink)
</span><span class="cx">         m_audioSink = createAudioSink();
</span><span class="cx"> 
</span><del>-    g_object_set(m_pipeline.get(), "audio-sink", m_audioSink.get(), nullptr);
-    if (m_player->isVideoPlayer())
-        g_object_set(m_pipeline.get(), "video-sink", createVideoSink(), nullptr);
</del><ins>+    g_object_set(m_pipeline.get(), "audio-sink", m_audioSink.get(), "video-sink", createVideoSink(), nullptr);
</ins><span class="cx"> 
</span><span class="cx">     if (m_shouldPreservePitch) {
</span><span class="cx">         GstElement* scale = gst_element_factory_make("scaletempo", nullptr);
</span><span class="lines">@@ -3420,6 +3418,11 @@
</span><span class="cx"> {
</span><span class="cx">     acceleratedRenderingStateChanged();
</span><span class="cx"> 
</span><ins>+    if (!m_player->isVideoPlayer()) {
+        m_videoSink = gst_element_factory_make("fakevideosink", nullptr);
+        return m_videoSink.get();
+    }
+
</ins><span class="cx"> #if USE(GSTREAMER_HOLEPUNCH)
</span><span class="cx">     m_videoSink = createHolePunchVideoSink();
</span><span class="cx">     pushNextHolePunchBuffer();
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (277079 => 277080)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp       2021-05-06 10:55:52 UTC (rev 277079)
+++ trunk/Source/WebCore/testing/Internals.cpp  2021-05-06 11:11:39 UTC (rev 277080)
</span><span class="lines">@@ -3431,12 +3431,19 @@
</span><span class="cx">     page->setFullscreenControlsHidden(hidden);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO_PRESENTATION_MODE)
</del><ins>+#if ENABLE(VIDEO)
</ins><span class="cx"> bool Internals::isChangingPresentationMode(HTMLVideoElement& element) const
</span><span class="cx"> {
</span><ins>+#if ENABLE(VIDEO_PRESENTATION_MODE)
</ins><span class="cx">     return element.isChangingPresentationMode();
</span><ins>+#else
+    UNUSED_PARAM(element);
+    return false;
+#endif
</ins><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO_PRESENTATION_MODE)
</ins><span class="cx"> void Internals::setMockVideoPresentationModeEnabled(bool enabled)
</span><span class="cx"> {
</span><span class="cx">     Document* document = contextDocument();
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (277079 => 277080)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h 2021-05-06 10:55:52 UTC (rev 277079)
+++ trunk/Source/WebCore/testing/Internals.h    2021-05-06 11:11:39 UTC (rev 277080)
</span><span class="lines">@@ -539,8 +539,11 @@
</span><span class="cx">     void setFullscreenAutoHideDuration(double);
</span><span class="cx">     void setFullscreenControlsHidden(bool);
</span><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO)
+    bool isChangingPresentationMode(HTMLVideoElement&) const;
+#endif
+
</ins><span class="cx"> #if ENABLE(VIDEO_PRESENTATION_MODE)
</span><del>-    bool isChangingPresentationMode(HTMLVideoElement&) const;
</del><span class="cx">     void setMockVideoPresentationModeEnabled(bool);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (277079 => 277080)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl       2021-05-06 10:55:52 UTC (rev 277079)
+++ trunk/Source/WebCore/testing/Internals.idl  2021-05-06 11:11:39 UTC (rev 277080)
</span><span class="lines">@@ -599,7 +599,7 @@
</span><span class="cx">     undefined setFullscreenAutoHideDuration(double duration);
</span><span class="cx">     undefined setFullscreenControlsHidden(boolean hidden);
</span><span class="cx"> 
</span><del>-    [Conditional=VIDEO_PRESENTATION_MODE] boolean isChangingPresentationMode(HTMLVideoElement element);
</del><ins>+    [Conditional=VIDEO] boolean isChangingPresentationMode(HTMLVideoElement element);
</ins><span class="cx">     [Conditional=VIDEO_PRESENTATION_MODE] undefined setMockVideoPresentationModeEnabled(boolean enabled);
</span><span class="cx"> 
</span><span class="cx">     undefined setApplicationCacheOriginQuota(unsigned long long quota);
</span></span></pre>
</div>
</div>

</body>
</html>