Implement MediaError::Message

The spec says that it's ok to put an empty string in it if we don't have more
informations.
This commit is contained in:
Anthony Ramine 2017-10-04 11:41:41 +02:00
parent b8c55e7da6
commit eb0c1a53ad
4 changed files with 7 additions and 14 deletions

View file

@ -5,6 +5,7 @@
use dom::bindings::codegen::Bindings::MediaErrorBinding::{self, MediaErrorMethods};
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::root::DomRoot;
use dom::bindings::str::DOMString;
use dom::window::Window;
use dom_struct::dom_struct;
@ -34,4 +35,9 @@ impl MediaErrorMethods for MediaError {
fn Code(&self) -> u16 {
self.code
}
// https://html.spec.whatwg.org/multipage/#dom-mediaerror-message
fn Message(&self) -> DOMString {
DOMString::new()
}
}

View file

@ -11,4 +11,5 @@ interface MediaError {
const unsigned short MEDIA_ERR_DECODE = 3;
const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
readonly attribute unsigned short code;
readonly attribute DOMString message;
};