Implement HTMLMediaElement.loop Attribute

This commit is contained in:
Swarnim Arun 2019-04-20 14:10:53 +05:30
parent 63b4455837
commit 3bf3a7861a
2 changed files with 6 additions and 7 deletions

View file

@ -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

View file

@ -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();