diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index 47f8e59bc10f..a339bf14e289 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -4172,13 +4172,6 @@ HTMLMediaElement::WakeLockBoolWrapper::~WakeLockBoolWrapper()
}
}
-void
-HTMLMediaElement::WakeLockBoolWrapper::SetCanPlay(bool aCanPlay)
-{
- mCanPlay = aCanPlay;
- UpdateWakeLock();
-}
-
void
HTMLMediaElement::WakeLockBoolWrapper::UpdateWakeLock()
{
@@ -4188,7 +4181,7 @@ HTMLMediaElement::WakeLockBoolWrapper::UpdateWakeLock()
return;
}
- bool playing = (!mValue && mCanPlay);
+ bool playing = !mValue;
if (playing) {
if (mTimer) {
diff --git a/dom/html/HTMLMediaElement.h b/dom/html/HTMLMediaElement.h
index 85e0bada6c5f..30a9c6d8a180 100644
--- a/dom/html/HTMLMediaElement.h
+++ b/dom/html/HTMLMediaElement.h
@@ -818,12 +818,13 @@ protected:
class WakeLockBoolWrapper {
public:
explicit WakeLockBoolWrapper(bool val = false)
- : mValue(val), mCanPlay(true), mOuter(nullptr) {}
+ : mValue(val)
+ , mOuter(nullptr)
+ {}
~WakeLockBoolWrapper();
void SetOuter(HTMLMediaElement* outer) { mOuter = outer; }
- void SetCanPlay(bool aCanPlay);
MOZ_IMPLICIT operator bool() const { return mValue; }
@@ -837,7 +838,6 @@ protected:
void UpdateWakeLock();
bool mValue;
- bool mCanPlay;
HTMLMediaElement* mOuter;
nsCOMPtr mTimer;
};
diff --git a/dom/html/HTMLVideoElement.cpp b/dom/html/HTMLVideoElement.cpp
index af19f32ea422..6aba8dfc00c5 100644
--- a/dom/html/HTMLVideoElement.cpp
+++ b/dom/html/HTMLVideoElement.cpp
@@ -47,7 +47,6 @@ NS_IMPL_ELEMENT_CLONE(HTMLVideoElement)
HTMLVideoElement::HTMLVideoElement(already_AddRefed& aNodeInfo)
: HTMLMediaElement(aNodeInfo)
- , mUseScreenWakeLock(true)
, mIsOrientationLocked(false)
{
}
@@ -230,19 +229,6 @@ bool HTMLVideoElement::MozHasAudio() const
return HasAudio();
}
-bool HTMLVideoElement::MozUseScreenWakeLock() const
-{
- MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
- return mUseScreenWakeLock;
-}
-
-void HTMLVideoElement::SetMozUseScreenWakeLock(bool aValue)
-{
- MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
- mUseScreenWakeLock = aValue;
- UpdateScreenWakeLock();
-}
-
JSObject*
HTMLVideoElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto)
{
@@ -334,7 +320,7 @@ HTMLVideoElement::UpdateScreenWakeLock()
{
bool hidden = OwnerDoc()->Hidden();
- if (mScreenWakeLock && (mPaused || hidden || !mUseScreenWakeLock)) {
+ if (mScreenWakeLock && (mPaused || hidden)) {
ErrorResult rv;
mScreenWakeLock->Unlock(rv);
rv.SuppressException();
@@ -342,8 +328,7 @@ HTMLVideoElement::UpdateScreenWakeLock()
return;
}
- if (!mScreenWakeLock && !mPaused && !hidden &&
- mUseScreenWakeLock && HasVideo()) {
+ if (!mScreenWakeLock && !mPaused && !hidden && HasVideo()) {
RefPtr pmService =
power::PowerManagerService::GetInstance();
NS_ENSURE_TRUE_VOID(pmService);
diff --git a/dom/html/HTMLVideoElement.h b/dom/html/HTMLVideoElement.h
index ec1f1e5c9e20..c43bc8cd8a9b 100644
--- a/dom/html/HTMLVideoElement.h
+++ b/dom/html/HTMLVideoElement.h
@@ -129,10 +129,6 @@ public:
bool MozHasAudio() const;
- bool MozUseScreenWakeLock() const;
-
- void SetMozUseScreenWakeLock(bool aValue);
-
void NotifyOwnerDocumentActivityChanged() override;
// Gives access to the decoder's frame statistics, if present.
@@ -165,7 +161,6 @@ protected:
virtual void WakeLockRelease() override;
void UpdateScreenWakeLock();
- bool mUseScreenWakeLock;
RefPtr mScreenWakeLock;
bool mIsOrientationLocked;
diff --git a/dom/webidl/HTMLVideoElement.webidl b/dom/webidl/HTMLVideoElement.webidl
index 6caa4f2f781d..53c612f52858 100644
--- a/dom/webidl/HTMLVideoElement.webidl
+++ b/dom/webidl/HTMLVideoElement.webidl
@@ -46,10 +46,6 @@ partial interface HTMLVideoElement {
// True if the video has an audio track available.
readonly attribute boolean mozHasAudio;
- // True if the video should use a screen wake lock.
- [Pref="dom.wakelock.enabled", Func="Navigator::HasWakeLockSupport"]
- attribute boolean mozUseScreenWakeLock;
-
// Attributes for builtin video controls to lock screen orientation.
// True if video controls should lock orientation when fullscreen.
[Pref="media.videocontrols.lock-video-orientation", Func="IsChromeOrXBL"]