aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-04-29 12:20:43 -0400
committerGitHub <noreply@github.com>2019-04-29 12:20:43 -0400
commit67beaa46e2015643e76becf18f415430ecb382bf (patch)
tree4565ec00838ae108166807923955512a42a89aec
parenta9f7b132303f7c02648043df5ebdc25726bd3f88 (diff)
parent4383f4de487a6efd49745a568ce27435862e868d (diff)
downloadservo-67beaa46e2015643e76becf18f415430ecb382bf.tar.gz
servo-67beaa46e2015643e76becf18f415430ecb382bf.zip
Auto merge of #23236 - swarnimarun:loop_patch, r=ferjm
Implement HTMLMediaElement.loop Attribute <!-- Please describe your changes on the following line: --> Work done for Implementing HTMLMediaElement.loop Attribute, - Uncomment `loop` attribute from webidl - Add make_bool macros for Loop and SetLoop functions - Update the required tests --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22290 <!-- Either: --> - [x] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23236) <!-- Reviewable:end -->
-rw-r--r--components/script/dom/htmlmediaelement.rs11
-rw-r--r--components/script/dom/webidls/HTMLMediaElement.webidl2
-rw-r--r--tests/wpt/metadata/html/dom/interfaces.https.html.ini16
-rw-r--r--tests/wpt/metadata/html/semantics/embedded-content/media-elements/video_loop_base.html.ini3
4 files changed, 15 insertions, 17 deletions
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index 74c7c7ade62..066c53484e6 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/components/script/dom/htmlmediaelement.rs
@@ -1548,17 +1548,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 {
@@ -1587,6 +1581,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();
diff --git a/tests/wpt/metadata/html/dom/interfaces.https.html.ini b/tests/wpt/metadata/html/dom/interfaces.https.html.ini
index 0b822e364fb..6d07d591f9b 100644
--- a/tests/wpt/metadata/html/dom/interfaces.https.html.ini
+++ b/tests/wpt/metadata/html/dom/interfaces.https.html.ini
@@ -1053,7 +1053,7 @@
expected: FAIL
[HTMLMediaElement interface: document.createElement("video") must inherit property "loop" with the proper type]
- expected: FAIL
+ expected: PASS
[HTMLMediaElement interface: document.createElement("video") must inherit property "controls" with the proper type]
expected: FAIL
@@ -1122,7 +1122,7 @@
expected: FAIL
[HTMLMediaElement interface: document.createElement("audio") must inherit property "loop" with the proper type]
- expected: FAIL
+ expected: PASS
[HTMLMediaElement interface: document.createElement("audio") must inherit property "controls" with the proper type]
expected: FAIL
@@ -1257,7 +1257,7 @@
expected: FAIL
[HTMLMediaElement interface: new Audio() must inherit property "loop" with the proper type]
- expected: FAIL
+ expected: PASS
[HTMLMediaElement interface: new Audio() must inherit property "play()" with the proper type]
expected: FAIL
@@ -1404,7 +1404,7 @@
expected: FAIL
[HTMLMediaElement interface: attribute loop]
- expected: FAIL
+ expected: PASS
[HTMLMediaElement interface: operation play()]
expected: FAIL
@@ -6778,7 +6778,7 @@
expected: FAIL
[HTMLMediaElement interface: document.createElement("video") must inherit property "loop" with the proper type]
- expected: FAIL
+ expected: PASS
[HTMLMediaElement interface: document.createElement("video") must inherit property "controls" with the proper type]
expected: FAIL
@@ -6796,7 +6796,7 @@
expected: FAIL
[HTMLMediaElement interface: document.createElement("audio") must inherit property "loop" with the proper type]
- expected: FAIL
+ expected: PASS
[HTMLMediaElement interface: document.createElement("audio") must inherit property "controls" with the proper type]
expected: FAIL
@@ -6814,7 +6814,7 @@
expected: FAIL
[HTMLMediaElement interface: new Audio() must inherit property "loop" with the proper type]
- expected: FAIL
+ expected: PASS
[HTMLMediaElement interface: new Audio() must inherit property "controls" with the proper type]
expected: FAIL
@@ -6829,7 +6829,7 @@
expected: FAIL
[HTMLMediaElement interface: attribute loop]
- expected: FAIL
+ expected: PASS
[HTMLMediaElement interface: operation play()]
expected: FAIL
diff --git a/tests/wpt/metadata/html/semantics/embedded-content/media-elements/video_loop_base.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/media-elements/video_loop_base.html.ini
index 9d801529171..22ae205ea3a 100644
--- a/tests/wpt/metadata/html/semantics/embedded-content/media-elements/video_loop_base.html.ini
+++ b/tests/wpt/metadata/html/semantics/embedded-content/media-elements/video_loop_base.html.ini
@@ -1,5 +1,4 @@
[video_loop_base.html]
- expected: TIMEOUT
[Check if video.loop is set to true that expecting the seeking event is fired more than once]
- expected: NOTRUN
+ expected: PASS