Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1124)

Unified Diff: Source/core/html/HTMLVideoElement.cpp

Issue 1240573005: Make video.webkitSupportsFullscreen an alias of document.fullscreenEnabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: move comments to assert descriptions Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/html/HTMLVideoElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLVideoElement.cpp
diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp
index 664ddda43070c3ddfc168a4fb38ca64bbaa92542..5c9fb839fa421a46249b53229986a608c5440860 100644
--- a/Source/core/html/HTMLVideoElement.cpp
+++ b/Source/core/html/HTMLVideoElement.cpp
@@ -32,6 +32,7 @@
#include "core/dom/Attribute.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
+#include "core/dom/Fullscreen.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/frame/Settings.h"
#include "core/html/parser/HTMLParserIdioms.h"
@@ -136,17 +137,6 @@ void HTMLVideoElement::parseAttribute(const QualifiedName& name, const AtomicStr
}
}
-bool HTMLVideoElement::supportsFullscreen() const
-{
- if (!document().page())
- return false;
-
- if (!webMediaPlayer())
- return false;
-
- return true;
-}
-
unsigned HTMLVideoElement::videoWidth() const
{
if (!webMediaPlayer())
@@ -232,17 +222,10 @@ bool HTMLVideoElement::hasAvailableVideoFrame() const
return webMediaPlayer()->hasVideo() && webMediaPlayer()->readyState() >= WebMediaPlayer::ReadyStateHaveCurrentData;
}
-void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& exceptionState)
+void HTMLVideoElement::webkitEnterFullscreen()
{
- if (isFullscreen())
- return;
-
- if (!supportsFullscreen()) {
- exceptionState.throwDOMException(InvalidStateError, "This element does not support fullscreen mode.");
- return;
- }
-
- enterFullscreen();
+ if (!isFullscreen())
+ enterFullscreen();
}
void HTMLVideoElement::webkitExitFullscreen()
@@ -253,7 +236,7 @@ void HTMLVideoElement::webkitExitFullscreen()
bool HTMLVideoElement::webkitSupportsFullscreen()
{
- return supportsFullscreen();
+ return Fullscreen::fullscreenEnabled(document());
}
bool HTMLVideoElement::webkitDisplayingFullscreen()
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/html/HTMLVideoElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698