aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSwarnim Arun <swarnimarun11@gmail.com>2019-04-20 14:10:53 +0530
committerSwarnim Arun <swarnimarun11@gmail.com>2019-04-26 23:13:18 +0530
commit3bf3a7861aab1a457682144e9debda084da69f7d (patch)
treea6ba9cad824593802ba3d1592718a3ec6a78eda4
parent63b4455837a08fac47ed6589d3aa7e1929a17863 (diff)
downloadservo-3bf3a7861aab1a457682144e9debda084da69f7d.tar.gz
servo-3bf3a7861aab1a457682144e9debda084da69f7d.zip
Implement HTMLMediaElement.loop Attribute
-rw-r--r--components/script/dom/htmlmediaelement.rs11
-rw-r--r--components/script/dom/webidls/HTMLMediaElement.webidl2
2 files changed, 6 insertions, 7 deletions
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index 51170564be2..ea5e0d1afeb 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/components/script/dom/htmlmediaelement.rs
@@ -1547,17 +1547,11 @@ enum PlaybackDirection {
// XXX Placeholder implementations for:
//
// - https://github.com/servo/servo/issues/22293
-// - https://github.com/servo/servo/issues/22321
impl HTMLMediaElement {
// https://github.com/servo/servo/issues/22293
fn direction_of_playback(&self) -> PlaybackDirection {
PlaybackDirection::Forwards
}
-
- // https://github.com/servo/servo/pull/22321
- fn Loop(&self) -> bool {
- false
- }
}
impl Drop for HTMLMediaElement {
@@ -1586,6 +1580,11 @@ impl HTMLMediaElementMethods for HTMLMediaElement {
// https://html.spec.whatwg.org/multipage/#dom-media-autoplay
make_bool_setter!(SetAutoplay, "autoplay");
+ // https://html.spec.whatwg.org/multipage/#attr-media-loop
+ make_bool_getter!(Loop, "loop");
+ // https://html.spec.whatwg.org/multipage/#attr-media-loop
+ make_bool_setter!(SetLoop, "loop");
+
// https://html.spec.whatwg.org/multipage/#dom-media-defaultmuted
make_bool_getter!(DefaultMuted, "muted");
// https://html.spec.whatwg.org/multipage/#dom-media-defaultmuted
diff --git a/components/script/dom/webidls/HTMLMediaElement.webidl b/components/script/dom/webidls/HTMLMediaElement.webidl
index ee15d4b0dc3..71f6120abaf 100644
--- a/components/script/dom/webidls/HTMLMediaElement.webidl
+++ b/components/script/dom/webidls/HTMLMediaElement.webidl
@@ -48,7 +48,7 @@ interface HTMLMediaElement : HTMLElement {
// readonly attribute TimeRanges seekable;
readonly attribute boolean ended;
[CEReactions] attribute boolean autoplay;
- // [CEReactions] attribute boolean loop;
+ [CEReactions] attribute boolean loop;
Promise<void> play();
void pause();