Title: [218847] trunk
Revision
218847
Author
commit-qu...@webkit.org
Date
2017-06-27 15:39:21 -0700 (Tue, 27 Jun 2017)

Log Message

Disable m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause
https://bugs.webkit.org/show_bug.cgi?id=173843
rdar://problem/32982431

Patch by Jeremy Jones <jere...@apple.com> on 2017-06-27
Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-fullscreen-pause-inline.html

Some pages may not have a fullscreen button, so disabled m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::pause):

LayoutTests:

Some pages may not have a fullscreen button, so disabled m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause.

* media/media-fullscreen-pause-inline-expected.txt: Added.
* media/media-fullscreen-pause-inline.html: Added.
* platform/mac-wk2/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (218846 => 218847)


--- trunk/LayoutTests/ChangeLog	2017-06-27 21:49:04 UTC (rev 218846)
+++ trunk/LayoutTests/ChangeLog	2017-06-27 22:39:21 UTC (rev 218847)
@@ -1,3 +1,17 @@
+2017-06-27  Jeremy Jones  <jere...@apple.com>
+
+        Disable m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause
+        https://bugs.webkit.org/show_bug.cgi?id=173843
+        rdar://problem/32982431
+
+        Reviewed by Eric Carlson.
+
+        Some pages may not have a fullscreen button, so disabled m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause.
+
+        * media/media-fullscreen-pause-inline-expected.txt: Added.
+        * media/media-fullscreen-pause-inline.html: Added.
+        * platform/mac-wk2/TestExpectations:
+
 2017-06-27  Saam Barati  <sbar...@apple.com>
 
         Function constructor needs to follow the spec and validate parameters and body independently

Added: trunk/LayoutTests/media/media-fullscreen-pause-inline-expected.txt (0 => 218847)


--- trunk/LayoutTests/media/media-fullscreen-pause-inline-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/media-fullscreen-pause-inline-expected.txt	2017-06-27 22:39:21 UTC (rev 218847)
@@ -0,0 +1,18 @@
+
+RUN(internals.settings.setAllowsInlineMediaPlayback(false))
+RUN(internals.settings.setAllowsInlineMediaPlaybackAfterFullscreen(true))
+RUN(internals.settings.setFullScreenEnabled(false))
+RUN(internals.setMediaElementRestrictions(video, "NoRestrictions"))
+RUN(video.src = "" "content/test"))
+RUN(video.play().then(playing);)
+EXPECTED (video.webkitDisplayingFullscreen == 'true') OK
+RUN(video.webkitExitFullscreen())
+EVENT(webkitendfullscreen)
+EXPECTED (video.paused == 'false') OK
+RUN(video.pause())
+EVENT(pause)
+EXPECTED (video.paused == 'true') OK
+RUN(video.play().then(playingAgain))
+EXPECTED (video.webkitDisplayingFullscreen == 'true') OK
+END OF TEST
+

Added: trunk/LayoutTests/media/media-fullscreen-pause-inline.html (0 => 218847)


--- trunk/LayoutTests/media/media-fullscreen-pause-inline.html	                        (rev 0)
+++ trunk/LayoutTests/media/media-fullscreen-pause-inline.html	2017-06-27 22:39:21 UTC (rev 218847)
@@ -0,0 +1,55 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] -->
+<html>
+<head>
+    <title>media-fullscreen-return-to-inline</title>
+
+    <script src=""
+    <script src=""
+
+    <script>
+    function go()
+    {
+        findMediaElement();
+        run('internals.settings.setAllowsInlineMediaPlayback(false)');
+        run('internals.settings.setAllowsInlineMediaPlaybackAfterFullscreen(true)');
+        run('internals.settings.setFullScreenEnabled(false)');
+        run('internals.setMediaElementRestrictions(video, "NoRestrictions")');
+        run('video.src = "" "content/test")');
+        run('video.play().then(playing);');
+    }
+
+    function playing()
+    {
+        testExpected('video.webkitDisplayingFullscreen', true);
+        waitForEventOnce('webkitendfullscreen', endfullscreen);
+        run('video.webkitExitFullscreen()');
+    }
+
+    function endfullscreen()
+    {
+        testExpected('video.paused', false);
+        run('video.pause()');
+        waitForEventOnce('pause', paused);
+    }
+
+    function paused()
+    {
+        testExpected('video.paused', true);
+        setTimeout(function(){ run('video.play().then(playingAgain)');}, 0)
+    }
+
+    function playingAgain()
+    {
+
+        testExpected('video.webkitDisplayingFullscreen', true);
+        endTest();
+    }
+
+    </script>
+
+</head>
+
+<body _onload_="go()">
+    <video controls></video>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (218846 => 218847)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2017-06-27 21:49:04 UTC (rev 218846)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2017-06-27 22:39:21 UTC (rev 218847)
@@ -327,6 +327,7 @@
 
 # Video fullscreen is not implemented for mac wk2 in webkittestrunner
 media/media-fullscreen-loop-inline.html [ Skip ]
+media/media-fullscreen-pause-inline.html [ Skip ]
 
 ### END OF (1) Classified failures with bug reports
 ########################################

Modified: trunk/Source/WebCore/ChangeLog (218846 => 218847)


--- trunk/Source/WebCore/ChangeLog	2017-06-27 21:49:04 UTC (rev 218846)
+++ trunk/Source/WebCore/ChangeLog	2017-06-27 22:39:21 UTC (rev 218847)
@@ -1,3 +1,18 @@
+2017-06-27  Jeremy Jones  <jere...@apple.com>
+
+        Disable m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause
+        https://bugs.webkit.org/show_bug.cgi?id=173843
+        rdar://problem/32982431
+
+        Reviewed by Eric Carlson.
+
+        Test: media/media-fullscreen-pause-inline.html
+
+        Some pages may not have a fullscreen button, so disabled m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::pause):
+
 2017-06-27  Chris Dumez  <cdu...@apple.com>
 
         [iOS] Avoid taking / releasing process assertions too quickly due to database activity

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (218846 => 218847)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2017-06-27 21:49:04 UTC (rev 218846)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2017-06-27 22:39:21 UTC (rev 218847)
@@ -3242,7 +3242,9 @@
 void HTMLMediaElement::pause()
 {
     LOG(Media, "HTMLMediaElement::pause(%p)", this);
-
+    
+    m_temporarilyAllowingInlinePlaybackAfterFullscreen = false;
+    
     if (!m_mediaSession->playbackPermitted(*this))
         return;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to