aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlmediaelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmlmediaelement.rs')
-rw-r--r--components/script/dom/htmlmediaelement.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index 739025544e7..965dd83cee4 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/components/script/dom/htmlmediaelement.rs
@@ -46,6 +46,7 @@ use std::collections::VecDeque;
use std::mem;
use std::rc::Rc;
use std::sync::{Arc, Mutex};
+use style::attr::AttrValue;
use task_source::TaskSource;
use time::{self, Timespec, Duration};
@@ -837,8 +838,9 @@ impl HTMLMediaElementMethods for HTMLMediaElement {
// https://html.spec.whatwg.org/multipage/#dom-media-src
make_url_getter!(Src, "src");
+
// https://html.spec.whatwg.org/multipage/#dom-media-src
- make_setter!(SetSrc, "src");
+ make_url_setter!(SetSrc, "src");
// https://html.spec.whatwg.org/multipage/#dom-media-srcobject
fn GetSrcObject(&self) -> Option<DomRoot<Blob>> {
@@ -913,6 +915,13 @@ impl VirtualMethods for HTMLMediaElement {
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
}
+ fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
+ match name {
+ &local_name!("src") => AttrValue::from_url(document_from_node(self).base_url(), value.into()),
+ _ => self.super_type().unwrap().parse_plain_attribute(name, value),
+ }
+ }
+
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
self.super_type().unwrap().attribute_mutated(attr, mutation);