Skip to content
Permalink
Browse files
Disable m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause
https://bugs.webkit.org/show_bug.cgi?id=173843
rdar://problem/32982431

Patch by Jeremy Jones <jeremyj@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:

Canonical link: https://commits.webkit.org/190724@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Jeremy Jones authored and webkit-commit-queue committed Jun 27, 2017
1 parent 73a2b78 commit 22119d1d901dea5d469e11a54e56d1f6ef4c6021
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 1 deletion.
@@ -1,3 +1,17 @@
2017-06-27 Jeremy Jones <jeremyj@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 <sbarati@apple.com>

Function constructor needs to follow the spec and validate parameters and body independently
@@ -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 = findMediaFile("video", "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

@@ -0,0 +1,55 @@
<!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] -->
<html>
<head>
<title>media-fullscreen-return-to-inline</title>

<script src="video-test.js"></script>
<script src="media-file.js"></script>

<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 = findMediaFile("video", "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>
@@ -327,6 +327,7 @@ webkit.org/b/156077 inspector/heap/getRemoteObject.html [ Pass Failure ]

# 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
########################################
@@ -1,3 +1,18 @@
2017-06-27 Jeremy Jones <jeremyj@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 <cdumez@apple.com>

[iOS] Avoid taking / releasing process assertions too quickly due to database activity
@@ -3242,7 +3242,9 @@ bool HTMLMediaElement::playInternal()
void HTMLMediaElement::pause()
{
LOG(Media, "HTMLMediaElement::pause(%p)", this);


m_temporarilyAllowingInlinePlaybackAfterFullscreen = false;

if (!m_mediaSession->playbackPermitted(*this))
return;

0 comments on commit 22119d1

Please sign in to comment.