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::codegen::Bindings::MediaErrorBinding::{self, MediaErrorMethods};
use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::root::DomRoot; use dom::bindings::root::DomRoot;
use dom::bindings::str::DOMString;
use dom::window::Window; use dom::window::Window;
use dom_struct::dom_struct; use dom_struct::dom_struct;
@ -34,4 +35,9 @@ impl MediaErrorMethods for MediaError {
fn Code(&self) -> u16 { fn Code(&self) -> u16 {
self.code 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_DECODE = 3;
const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4; const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
readonly attribute unsigned short code; readonly attribute unsigned short code;
readonly attribute DOMString message;
}; };

View file

@ -9993,12 +9993,6 @@
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmousewheel" with the proper type (126)] [Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmousewheel" with the proper type (126)]
expected: FAIL expected: FAIL
[MediaError interface: attribute message]
expected: FAIL
[MediaError interface: errorVideo.error must inherit property "message" with the proper type (5)]
expected: FAIL
[HTMLScriptElement interface: attribute noModule] [HTMLScriptElement interface: attribute noModule]
expected: FAIL expected: FAIL

View file

@ -1,8 +0,0 @@
[error.html]
type: testharness
[audio.error after setting src to the empty string]
expected: FAIL
[video.error after setting src to the empty string]
expected: FAIL