Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
No need to enterFullscreen() when already in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=128276

Reviewed by Jer Noble.

No new tests, this is just cleanup.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState): Don't call enterFullscreen() if already there.
(WebCore::HTMLMediaElement::enterFullscreen): Return early if m_isFullscreen is already true.


Canonical link: https://commits.webkit.org/146317@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eric-carlson committed Feb 6, 2014
1 parent b530f2c commit 875c319
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 13 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,16 @@
2014-02-06 Eric Carlson <eric.carlson@apple.com>

No need to enterFullscreen() when already in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=128276

Reviewed by Jer Noble.

No new tests, this is just cleanup.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState): Don't call enterFullscreen() if already there.
(WebCore::HTMLMediaElement::enterFullscreen): Return early if m_isFullscreen is already true.

2014-02-06 Radu Stavila <stavila@adobe.com>

[CSS Regions] Null dereference applying animation with CSS regions
Expand Down
6 changes: 4 additions & 2 deletions Source/WebCore/html/HTMLMediaElement.cpp
Expand Up @@ -4268,7 +4268,7 @@ void HTMLMediaElement::updatePlayState()
invalidateCachedTime();

if (playerPaused) {
if (m_mediaSession->requiresFullscreenForVideoPlayback(*this))
if (m_mediaSession->requiresFullscreenForVideoPlayback(*this) && !isFullscreen())
enterFullscreen();

// Set rate, muted before calling play in case they were set before the media engine was setup.
Expand Down Expand Up @@ -4843,14 +4843,16 @@ void HTMLMediaElement::toggleFullscreenState()
void HTMLMediaElement::enterFullscreen()
{
LOG(Media, "HTMLMediaElement::enterFullscreen");
if (m_isFullscreen)
return;

#if ENABLE(FULLSCREEN_API)
if (document().settings() && document().settings()->fullScreenEnabled()) {
document().requestFullScreenForElement(this, 0, Document::ExemptIFrameAllowFullScreenRequirement);
return;
}
#endif
ASSERT(!m_isFullscreen);

m_isFullscreen = true;
if (hasMediaControls())
mediaControls()->enteredFullscreen();
Expand Down

0 comments on commit 875c319

Please sign in to comment.