Implement basic media resource selection and fetching.

This commit is contained in:
Josh Matthews 2015-11-06 22:43:11 -06:00
parent 5918954edd
commit eae27adc4a
107 changed files with 1722 additions and 9 deletions

View file

@ -21,6 +21,7 @@ pub enum LoadType {
Subframe(Url),
Stylesheet(Url),
PageSource(Url),
Media(Url),
}
impl LoadType {
@ -30,6 +31,7 @@ impl LoadType {
LoadType::Script(ref url) |
LoadType::Subframe(ref url) |
LoadType::Stylesheet(ref url) |
LoadType::Media(ref url) |
LoadType::PageSource(ref url) => url,
}
}
@ -39,7 +41,8 @@ impl LoadType {
LoadType::Image(_) => LoadContext::Image,
LoadType::Script(_) => LoadContext::Script,
LoadType::Subframe(_) | LoadType::PageSource(_) => LoadContext::Browsing,
LoadType::Stylesheet(_) => LoadContext::Style
LoadType::Stylesheet(_) => LoadContext::Style,
LoadType::Media(_) => LoadContext::AudioVideo,
}
}
}

View file

@ -2,25 +2,153 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use document_loader::LoadType;
use dom::attr::Attr;
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
use dom::bindings::codegen::Bindings::HTMLMediaElementBinding::HTMLMediaElementMethods;
use dom::bindings::codegen::Bindings::HTMLMediaElementBinding::HTMLMediaElementConstants;
use dom::bindings::codegen::Bindings::HTMLMediaElementBinding::HTMLMediaElementConstants::*;
use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::refcounted::Trusted;
use dom::document::Document;
use dom::element::AttributeMutation;
use dom::element::{Element, AttributeMutation};
use dom::event::{Event, EventBubbles, EventCancelable};
use dom::htmlelement::HTMLElement;
use dom::htmlsourceelement::HTMLSourceElement;
use dom::node::{window_from_node, document_from_node};
use dom::virtualmethods::VirtualMethods;
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use net_traits::{AsyncResponseListener, AsyncResponseTarget, Metadata, NetworkError};
use network_listener::{NetworkListener, PreInvoke};
use script_runtime::ScriptChan;
use script_thread::{Runnable, ScriptThread};
use std::cell::Cell;
use std::sync::{Arc, Mutex};
use string_cache::Atom;
use task_source::dom_manipulation::DOMManipulationTask;
use task_source::TaskSource;
use time::{self, Timespec, Duration};
use url::Url;
use util::str::DOMString;
struct HTMLMediaElementContext {
/// The element that initiated the request.
elem: Trusted<HTMLMediaElement>,
/// The response body received to date.
data: Vec<u8>,
/// The response metadata received to date.
metadata: Option<Metadata>,
/// The generation of the media element when this fetch started.
generation_id: u32,
/// Time of last progress notification.
next_progress_event: Timespec,
/// Url of resource requested.
url: Url,
/// Whether the media metadata has been completely received.
have_metadata: bool,
/// True if this response is invalid and should be ignored.
ignore_response: bool,
}
// https://html.spec.whatwg.org/multipage/#media-data-processing-steps-list
impl AsyncResponseListener for HTMLMediaElementContext {
// https://html.spec.whatwg.org/multipage/#media-data-processing-steps-list
fn headers_available(&mut self, metadata: Result<Metadata, NetworkError>) {
self.metadata = metadata.ok();
// => "If the media data cannot be fetched at all..."
let is_failure = self.metadata
.as_ref()
.and_then(|m| m.status
.as_ref()
.map(|s| s.0 < 200 || s.0 >= 300))
.unwrap_or(false);
if is_failure {
// Ensure that the element doesn't receive any further notifications
// of the aborted fetch. The dedicated failure steps will be executed
// when response_complete runs.
self.ignore_response = true;
}
}
fn data_available(&mut self, payload: Vec<u8>) {
if self.ignore_response {
return;
}
let mut payload = payload;
self.data.append(&mut payload);
let elem = self.elem.root();
if !self.have_metadata {
//TODO: actually check if the payload contains the full metadata
elem.change_ready_state(HAVE_METADATA);
self.have_metadata = true;
} else {
elem.change_ready_state(HAVE_CURRENT_DATA);
}
if time::get_time() > self.next_progress_event {
elem.queue_fire_simple_event("progress");
self.next_progress_event = time::get_time() + Duration::milliseconds(350);
}
}
// https://html.spec.whatwg.org/multipage/#media-data-processing-steps-list
fn response_complete(&mut self, status: Result<(), NetworkError>) {
let elem = self.elem.root();
if status.is_ok() {
elem.change_ready_state(HAVE_ENOUGH_DATA);
elem.fire_simple_event("progress");
elem.network_state.set(NETWORK_IDLE);
elem.fire_simple_event("suspend");
} else {
elem.queue_dedicated_media_source_failure_steps();
}
let document = document_from_node(&*elem);
document.finish_load(LoadType::Media(self.url.clone()));
}
}
impl PreInvoke for HTMLMediaElementContext {
fn should_invoke(&self) -> bool {
//TODO: finish_load needs to run at some point if the generation changes.
self.elem.root().generation_id.get() == self.generation_id
}
}
impl HTMLMediaElementContext {
fn new(elem: &HTMLMediaElement, url: Url) -> HTMLMediaElementContext {
HTMLMediaElementContext {
elem: Trusted::new(elem),
data: vec![],
metadata: None,
generation_id: elem.generation_id.get(),
next_progress_event: time::get_time() + Duration::milliseconds(350),
url: url,
have_metadata: false,
ignore_response: false,
}
}
}
#[dom_struct]
pub struct HTMLMediaElement {
htmlelement: HTMLElement,
network_state: Cell<u16>,
ready_state: Cell<u16>,
current_src: DOMRefCell<String>,
generation_id: Cell<u32>,
first_data_load: Cell<bool>,
}
impl HTMLMediaElement {
@ -30,9 +158,11 @@ impl HTMLMediaElement {
HTMLMediaElement {
htmlelement:
HTMLElement::new_inherited(tag_name, prefix, document),
network_state: Cell::new(HTMLMediaElementConstants::NETWORK_EMPTY),
ready_state: Cell::new(HTMLMediaElementConstants::HAVE_NOTHING),
network_state: Cell::new(NETWORK_EMPTY),
ready_state: Cell::new(HAVE_NOTHING),
current_src: DOMRefCell::new("".to_owned()),
generation_id: Cell::new(0),
first_data_load: Cell::new(true),
}
}
@ -41,7 +171,268 @@ impl HTMLMediaElement {
&self.htmlelement
}
fn media_element_load_algorithm(&self, _src: &str) {
fn queue_fire_simple_event(&self, type_: &'static str) {
let win = window_from_node(self);
let task = FireSimpleEventTask::new(self, type_);
let _ = win.dom_manipulation_task_source().queue(DOMManipulationTask::MediaTask(box task));
}
fn fire_simple_event(&self, type_: &str) {
let window = window_from_node(self);
let event = Event::new(GlobalRef::Window(&*window),
Atom::from(type_),
EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable);
event.fire(self.upcast());
}
// https://html.spec.whatwg.org/multipage/#ready-states
fn change_ready_state(&self, ready_state: u16) {
let old_ready_state = self.ready_state.get();
self.ready_state.set(ready_state);
if self.network_state.get() == NETWORK_EMPTY {
return;
}
match (old_ready_state, ready_state) {
// previous ready state was HAVE_NOTHING, and the new ready state is
// HAVE_METADATA
(HAVE_NOTHING, HAVE_METADATA) => {
self.queue_fire_simple_event("loadedmetadata");
}
// previous ready state was HAVE_METADATA and the new ready state is
// HAVE_CURRENT_DATA or greater
(HAVE_METADATA, HAVE_CURRENT_DATA) |
(HAVE_METADATA, HAVE_FUTURE_DATA) |
(HAVE_METADATA, HAVE_ENOUGH_DATA) => {
if self.first_data_load.get() {
self.first_data_load.set(false);
self.queue_fire_simple_event("loadeddata");
}
}
// previous ready state was HAVE_FUTURE_DATA or more, and the new ready
// state is HAVE_CURRENT_DATA or less
(HAVE_FUTURE_DATA, HAVE_CURRENT_DATA) |
(HAVE_ENOUGH_DATA, HAVE_CURRENT_DATA) |
(HAVE_FUTURE_DATA, HAVE_METADATA) |
(HAVE_ENOUGH_DATA, HAVE_METADATA) |
(HAVE_FUTURE_DATA, HAVE_NOTHING) |
(HAVE_ENOUGH_DATA, HAVE_NOTHING) => {
// TODO: timeupdate event logic + waiting
}
_ => (),
}
// If the new ready state is HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA,
// then the relevant steps below must then be run also.
match (old_ready_state, ready_state) {
// previous ready state was HAVE_CURRENT_DATA or less, and the new ready
// state is HAVE_FUTURE_DATA
(HAVE_CURRENT_DATA, HAVE_FUTURE_DATA) |
(HAVE_METADATA, HAVE_FUTURE_DATA) |
(HAVE_NOTHING, HAVE_FUTURE_DATA) => {
self.queue_fire_simple_event("canplay");
// TODO: check paused state
self.queue_fire_simple_event("playing");
}
// new ready state is HAVE_ENOUGH_DATA
(_, HAVE_ENOUGH_DATA) => {
if old_ready_state <= HAVE_CURRENT_DATA {
self.queue_fire_simple_event("canplay");
//TODO: check paused state
self.queue_fire_simple_event("playing");
}
// TODO: autoplay-related logic
self.queue_fire_simple_event("canplaythrough");
}
_ => (),
}
}
// https://html.spec.whatwg.org/multipage/#concept-media-load-algorithm
fn invoke_resource_selection_algorithm(&self, base_url: Url) {
// Step 1
self.network_state.set(NETWORK_NO_SOURCE);
// TODO step 2 (show poster)
// TODO step 3 (delay load event)
// Step 4
ScriptThread::await_stable_state(ResourceSelectionTask::new(self, base_url));
}
// https://html.spec.whatwg.org/multipage/#concept-media-load-algorithm
fn resource_selection_algorithm_sync(&self, base_url: Url) {
// TODO step 5 (populate pending text tracks)
// Step 6
let mode = if false {
// TODO media provider object
ResourceSelectionMode::Object
} else if let Some(attr) = self.upcast::<Element>().get_attribute(&ns!(), &atom!("src")) {
ResourceSelectionMode::Attribute(attr.Value().to_string())
} else if false {
// TODO <source> child
ResourceSelectionMode::Children(panic!())
} else {
self.network_state.set(NETWORK_EMPTY);
return;
};
// Step 7
self.network_state.set(NETWORK_LOADING);
// Step 8
self.queue_fire_simple_event("loadstart");
// Step 9
match mode {
ResourceSelectionMode::Object => {
// Step 1
*self.current_src.borrow_mut() = "".to_owned();
// Step 4
self.resource_fetch_algorithm(Resource::Object);
}
ResourceSelectionMode::Attribute(src) => {
// Step 1
if src.is_empty() {
// TODO failed with attribute
return;
}
// Step 2
let absolute_url = base_url.join(&src).map_err(|_| ());
// Step 3
if let Ok(url) = absolute_url {
*self.current_src.borrow_mut() = url.as_str().into();
// Step 4
self.resource_fetch_algorithm(Resource::Url(url));
} else {
self.queue_dedicated_media_source_failure_steps();
}
}
ResourceSelectionMode::Children(_child) => {
// TODO
self.queue_dedicated_media_source_failure_steps()
}
}
}
// https://html.spec.whatwg.org/multipage/#concept-media-load-resource
fn resource_fetch_algorithm(&self, resource: Resource) {
// TODO step 3 (remove text tracks)
// Step 4
if let Resource::Url(url) = resource {
// TODO 4.1 (preload=none)
// 4.2
let context = Arc::new(Mutex::new(HTMLMediaElementContext::new(self, url.clone())));
let (action_sender, action_receiver) = ipc::channel().unwrap();
let script_chan = window_from_node(self).networking_task_source();
let listener = box NetworkListener {
context: context,
script_chan: script_chan,
};
let response_target = AsyncResponseTarget {
sender: action_sender,
};
ROUTER.add_route(action_receiver.to_opaque(), box move |message| {
listener.notify(message.to().unwrap());
});
// FIXME: we're supposed to block the load event much earlier than now
let doc = document_from_node(self);
doc.load_async(LoadType::Media(url), response_target);
} else {
// TODO local resource fetch
self.queue_dedicated_media_source_failure_steps();
}
}
fn queue_dedicated_media_source_failure_steps(&self) {
let _ = window_from_node(self).dom_manipulation_task_source().queue(
DOMManipulationTask::MediaTask(box DedicatedMediaSourceFailureTask::new(self)));
}
// https://html.spec.whatwg.org/multipage/#dedicated-media-source-failure-steps
fn dedicated_media_source_failure(&self) {
// TODO step 1 (error attribute)
// TODO step 2 (forget resource tracks)
// Step 3
self.network_state.set(NETWORK_NO_SOURCE);
// TODO step 4 (show poster)
// Step 5
self.fire_simple_event("error");
// TODO step 6 (delay load event)
}
// https://html.spec.whatwg.org/multipage/#media-element-load-algorithm
fn media_element_load_algorithm(&self) {
self.first_data_load.set(true);
// TODO Step 1 (abort resource selection algorithm instances)
// Step 2
self.generation_id.set(self.generation_id.get() + 1);
// Step 3
let network_state = self.NetworkState();
match network_state {
NETWORK_LOADING |
NETWORK_IDLE => {
self.queue_fire_simple_event("abort");
}
_ => (),
}
// Step 4
if network_state != NETWORK_EMPTY {
// 4.1
self.queue_fire_simple_event("emptied");
// TODO 4.2 (abort in-progress fetch)
// TODO 4.3 (forget resource tracks)
// 4.4
self.change_ready_state(HAVE_NOTHING);
// TODO 4.5 (paused)
// TODO 4.6 (seeking)
// TODO 4.7 (playback position)
// TODO 4.8 (timeline offset)
// TODO 4.9 (duration)
}
// TODO step 5 (playback rate)
// TODO step 6 (error/autoplaying)
// Step 7
let doc = document_from_node(self);
self.invoke_resource_selection_algorithm(doc.base_url());
// TODO step 8 (stop previously playing resource)
}
}
@ -75,11 +466,81 @@ impl VirtualMethods for HTMLMediaElement {
match attr.local_name() {
&atom!("src") => {
if let Some(value) = mutation.new_value(attr) {
self.media_element_load_algorithm(&value);
if mutation.new_value(attr).is_some() {
self.media_element_load_algorithm();
}
}
_ => (),
};
}
}
struct FireSimpleEventTask {
elem: Trusted<HTMLMediaElement>,
type_: &'static str,
}
impl FireSimpleEventTask {
fn new(target: &HTMLMediaElement, type_: &'static str) -> FireSimpleEventTask {
FireSimpleEventTask {
elem: Trusted::new(target),
type_: type_,
}
}
}
impl Runnable for FireSimpleEventTask {
fn handler(self: Box<FireSimpleEventTask>) {
let elem = self.elem.root();
elem.fire_simple_event(self.type_);
}
}
struct ResourceSelectionTask {
elem: Trusted<HTMLMediaElement>,
base_url: Url,
}
impl ResourceSelectionTask {
fn new(elem: &HTMLMediaElement, url: Url) -> ResourceSelectionTask {
ResourceSelectionTask {
elem: Trusted::new(elem),
base_url: url,
}
}
}
impl Runnable for ResourceSelectionTask {
fn handler(self: Box<ResourceSelectionTask>) {
self.elem.root().resource_selection_algorithm_sync(self.base_url);
}
}
struct DedicatedMediaSourceFailureTask {
elem: Trusted<HTMLMediaElement>,
}
impl DedicatedMediaSourceFailureTask {
fn new(elem: &HTMLMediaElement) -> DedicatedMediaSourceFailureTask {
DedicatedMediaSourceFailureTask {
elem: Trusted::new(elem),
}
}
}
impl Runnable for DedicatedMediaSourceFailureTask {
fn handler(self: Box<DedicatedMediaSourceFailureTask>) {
self.elem.root().dedicated_media_source_failure();
}
}
enum ResourceSelectionMode {
Object,
Attribute(String),
Children(Root<HTMLSourceElement>),
}
enum Resource {
Object,
Url(Url),
}

View file

@ -517,6 +517,19 @@ impl ScriptThread {
});
}
// https://html.spec.whatwg.org/multipage/#await-a-stable-state
pub fn await_stable_state<T: Runnable + Send + 'static>(task: T) {
//TODO use microtasks when they exist
SCRIPT_THREAD_ROOT.with(|root| {
if let Some(script_thread) = *root.borrow() {
let script_thread = unsafe { &*script_thread };
let _ = script_thread.chan.send(CommonScriptMsg::RunnableMsg(
ScriptThreadEventCategory::DomEvent,
box task));
}
});
}
/// Creates a new script thread.
pub fn new(state: InitialScriptState,
port: Receiver<MainThreadScriptMsg>,

View file

@ -0,0 +1,6 @@
[audio_loop_base.html]
type: testharness
expected: TIMEOUT
[Check if audio.loop is set to true that expecting the seeking event is fired more than once]
expected: NOTRUN

View file

@ -0,0 +1,8 @@
[audio_volume_check.html]
type: testharness
[Check if media.volume is set to new value less than 0.0 that expecting an IndexSizeError exception is to be thrown]
expected: FAIL
[Check if audio.volume is set to new value greater than 1.0 that expecting an IndexSizeError exception is to be thrown]
expected: FAIL

View file

@ -0,0 +1,21 @@
[error.html]
type: testharness
expected: TIMEOUT
[audio.error initial value]
expected: FAIL
[audio.error after successful load]
expected: TIMEOUT
[audio.error after setting src to the empty string]
expected: TIMEOUT
[video.error initial value]
expected: FAIL
[video.error after successful load]
expected: TIMEOUT
[video.error after setting src to the empty string]
expected: TIMEOUT

View file

@ -0,0 +1,9 @@
[event_loadeddata.html]
type: testharness
expected: TIMEOUT
[video events - loadeddata]
expected: FAIL
[setting src attribute on autoplay video should trigger loadeddata event]
expected: NOTRUN

View file

@ -0,0 +1,9 @@
[event_pause.html]
type: testharness
expected: TIMEOUT
[calling pause() on autoplay audio should trigger pause event]
expected: NOTRUN
[calling pause() on autoplay video should trigger pause event]
expected: NOTRUN

View file

@ -0,0 +1,15 @@
[event_pause_noautoplay.html]
type: testharness
expected: TIMEOUT
[audio events - pause]
expected: FAIL
[calling play() then pause() on non-autoplay audio should trigger pause event]
expected: NOTRUN
[video events - pause]
expected: FAIL
[calling play() then pause() on non-autoplay video should trigger pause event]
expected: NOTRUN

View file

@ -0,0 +1,9 @@
[event_play.html]
type: testharness
expected: TIMEOUT
[setting src attribute on autoplay audio should trigger play event]
expected: NOTRUN
[setting src attribute on autoplay video should trigger play event]
expected: NOTRUN

View file

@ -0,0 +1,15 @@
[event_play_noautoplay.html]
type: testharness
expected: TIMEOUT
[audio events - play]
expected: FAIL
[calling play() on audio should trigger play event]
expected: NOTRUN
[video events - play]
expected: FAIL
[calling play() on video should trigger play event]
expected: NOTRUN

View file

@ -0,0 +1,8 @@
[event_playing_noautoplay.html]
type: testharness
[audio events - playing]
expected: FAIL
[video events - playing]
expected: FAIL

View file

@ -0,0 +1,9 @@
[event_timeupdate.html]
type: testharness
expected: TIMEOUT
[setting src attribute on a sufficiently long autoplay audio should trigger timeupdate event]
expected: NOTRUN
[setting src attribute on a sufficiently long autoplay video should trigger timeupdate event]
expected: NOTRUN

View file

@ -0,0 +1,15 @@
[event_timeupdate_noautoplay.html]
type: testharness
expected: TIMEOUT
[audio events - timeupdate]
expected: FAIL
[calling play() on a sufficiently long audio should trigger timeupdate event]
expected: NOTRUN
[video events - timeupdate]
expected: FAIL
[calling play() on a sufficiently long video should trigger timeupdate event]
expected: NOTRUN

View file

@ -0,0 +1,27 @@
[event_volumechange.html]
type: testharness
expected: TIMEOUT
[setting audio.volume fires volumechange]
expected: FAIL
[setting audio.muted fires volumechange]
expected: FAIL
[setting audio.volume/muted to the same value does not fire volumechange]
expected: TIMEOUT
[setting audio.volume/muted repeatedly fires volumechange repeatedly]
expected: TIMEOUT
[setting video.volume fires volumechange]
expected: FAIL
[setting video.muted fires volumechange]
expected: FAIL
[setting video.volume/muted to the same value does not fire volumechange]
expected: TIMEOUT
[setting video.volume/muted repeatedly fires volumechange repeatedly]
expected: TIMEOUT

View file

@ -0,0 +1,5 @@
[historical.html]
type: testharness
[TextTrackCue constructor should not be supported]
expected: FAIL

View file

@ -0,0 +1,29 @@
[addTextTrack.html]
type: testharness
[HTMLMediaElement.addTextTrack subtitles first arg]
expected: FAIL
[HTMLMediaElement.addTextTrack captions first arg]
expected: FAIL
[HTMLMediaElement.addTextTrack descriptions first arg]
expected: FAIL
[HTMLMediaElement.addTextTrack chapters first arg]
expected: FAIL
[HTMLMediaElement.addTextTrack metadata first arg]
expected: FAIL
[HTMLMediaElement.addTextTrack undefined second and third arg]
expected: FAIL
[HTMLMediaElement.addTextTrack null second and third arg]
expected: FAIL
[HTMLMediaElement.addTextTrack foo and bar second and third arg]
expected: FAIL
[HTMLMediaElement.addTextTrack foo second arg, third arg omitted]
expected: FAIL

View file

@ -0,0 +1,5 @@
[textTracks.html]
type: testharness
[HTMLMediaElement.textTracks]
expected: FAIL

View file

@ -0,0 +1,23 @@
[default.html]
type: testharness
[HTMLTrackElement.default missing value]
expected: FAIL
[HTMLTrackElement.default empty string content attribute]
expected: FAIL
[HTMLTrackElement.default empty string IDL attribute]
expected: FAIL
[HTMLTrackElement.default foo in content attribute]
expected: FAIL
[HTMLTrackElement.default foo in IDL attribute]
expected: FAIL
[HTMLTrackElement.default true in IDL attribute]
expected: FAIL
[HTMLTrackElement.default false in IDL attribute]
expected: FAIL

View file

@ -0,0 +1,62 @@
[kind.html]
type: testharness
[HTMLTrackElement.kind missing value]
expected: FAIL
[HTMLTrackElement.kind invalid value in content attribute]
expected: FAIL
[HTMLTrackElement.kind content attribute uppercase]
expected: FAIL
[HTMLTrackElement.kind content attribute with uppercase turkish I (with dot)]
expected: FAIL
[HTMLTrackElement.kind content attribute with lowercase turkish i (dotless)]
expected: FAIL
[HTMLTrackElement.kind content attribute "subtitles"]
expected: FAIL
[HTMLTrackElement.kind content attribute "captions"]
expected: FAIL
[HTMLTrackElement.kind content attribute "descriptions"]
expected: FAIL
[HTMLTrackElement.kind content attribute "chapters"]
expected: FAIL
[HTMLTrackElement.kind content attribute "metadata"]
expected: FAIL
[HTMLTrackElement.kind content attribute "captions\\u0000"]
expected: FAIL
[HTMLTrackElement.kind setting IDL attribute to "subtitles"]
expected: FAIL
[HTMLTrackElement.kind setting IDL attribute to "captions"]
expected: FAIL
[HTMLTrackElement.kind setting IDL attribute to "descriptions"]
expected: FAIL
[HTMLTrackElement.kind setting IDL attribute to "chapters"]
expected: FAIL
[HTMLTrackElement.kind setting IDL attribute to "metadata"]
expected: FAIL
[HTMLTrackElement.kind setting IDL attribute to "CAPTIONS"]
expected: FAIL
[HTMLTrackElement.kind setting IDL attribute with uppercase turkish I (with dot)]
expected: FAIL
[HTMLTrackElement.kind setting IDL attribute with lowercase turkish I (dotless)]
expected: FAIL
[HTMLTrackElement.kind setting IDL attribute with \\u0000]
expected: FAIL

View file

@ -0,0 +1,35 @@
[label.html]
type: testharness
[HTMLTrackElement.label missing value]
expected: FAIL
[HTMLTrackElement.label empty string content attribute]
expected: FAIL
[HTMLTrackElement.label empty string IDL attribute]
expected: FAIL
[HTMLTrackElement.label lowercase content attribute]
expected: FAIL
[HTMLTrackElement.label uppercase content attribute]
expected: FAIL
[HTMLTrackElement.label\\u0000 in content attribute]
expected: FAIL
[HTMLTrackElement.label lowercase IDL attribute]
expected: FAIL
[HTMLTrackElement.label uppercase IDL attribute]
expected: FAIL
[HTMLTrackElement.label whitespace in content attribute]
expected: FAIL
[HTMLTrackElement.label whitespace in IDL attribute]
expected: FAIL
[HTMLTrackElement.label \\u0000 in IDL attribute]
expected: FAIL

View file

@ -0,0 +1,5 @@
[readyState.html]
type: testharness
[HTMLTrackElement.readyState default value]
expected: FAIL

View file

@ -0,0 +1,28 @@
[src.html]
type: testharness
[HTMLTrackElement.src missing value]
expected: FAIL
[HTMLTrackElement.src empty string in content attribute]
expected: FAIL
[HTMLTrackElement.src empty string in IDL attribute]
expected: FAIL
[HTMLTrackElement.src unresolvable value in content attribute]
expected: FAIL
[HTMLTrackElement.src assigning unresolvable value to IDL attribute]
expected: FAIL
[HTMLTrackElement.src assigning resolvable value to IDL attribute]
expected: FAIL
[HTMLTrackElement.src assigning \\u0000 to IDL attribute]
expected: FAIL
[HTMLTrackElement.src \\u0000 in content attribute]
expected: FAIL
[HTMLTrackElement.src resolvable value in content attribute]
expected: FAIL

View file

@ -0,0 +1,35 @@
[srclang.html]
type: testharness
[HTMLTrackElement.srclang missing value]
expected: FAIL
[HTMLTrackElement.srclang empty string content attribute]
expected: FAIL
[HTMLTrackElement.srclang empty string IDL attribute]
expected: FAIL
[HTMLTrackElement.srclang lowercase content attribute]
expected: FAIL
[HTMLTrackElement.srclang uppercase content attribute]
expected: FAIL
[HTMLTrackElement.srclang \\u0000 content attribute]
expected: FAIL
[HTMLTrackElement.srclang lowercase IDL attribute]
expected: FAIL
[HTMLTrackElement.srclang uppercase IDL attribute]
expected: FAIL
[HTMLTrackElement.srclang whitespace in content attribute]
expected: FAIL
[HTMLTrackElement.srclang whitespace in IDL attribute]
expected: FAIL
[HTMLTrackElement.srclang \\u0000 in IDL attribute]
expected: FAIL

View file

@ -0,0 +1,5 @@
[track.html]
type: testharness
[HTMLTrackElement.track]
expected: FAIL

View file

@ -0,0 +1,21 @@
[activeCues.html]
type: testharness
expected: ERROR
[TextTrack.activeCues, empty list]
expected: FAIL
[TextTrack.activeCues, after addCue()]
expected: FAIL
[TextTrack.activeCues, different modes]
expected: FAIL
[TextTrack.activeCues, video loading]
expected: FAIL
[TextTrack.activeCues, video playing]
expected: TIMEOUT
[TextTrack.activeCues, adding cue during playback]
expected: TIMEOUT

View file

@ -0,0 +1,17 @@
[addCue.html]
type: testharness
[TextTrack.addCue(), adding a cue to two different tracks]
expected: FAIL
[TextTrack.addCue(), adding a cue to a track twice]
expected: FAIL
[TextTrack.addCue(), adding a removed cue to a different track]
expected: FAIL
[TextTrack.addCue(), adding an associated but removed cue to the same track]
expected: FAIL
[TextTrack.addCue(), adding a cue associated with a track element to other track]
expected: FAIL

View file

@ -0,0 +1,6 @@
[constants.html]
type: testharness
expected: ERROR
[TextTrack constants]
expected: FAIL

View file

@ -0,0 +1,17 @@
[cues.html]
type: testharness
[TextTrack.cues, empty list]
expected: FAIL
[TextTrack.cues, after addCue()]
expected: FAIL
[TextTrack.cues, different modes]
expected: FAIL
[TextTrack.cues, changing order]
expected: FAIL
[TextTrack.cues, default attribute]
expected: FAIL

View file

@ -0,0 +1,11 @@
[kind.html]
type: testharness
[TextTrack.kind, addTextTrack]
expected: FAIL
[TextTrack.kind, track element]
expected: FAIL
[TextTrack.kind, \\u0000]
expected: FAIL

View file

@ -0,0 +1,9 @@
[label.html]
type: testharness
expected: ERROR
[TextTrack.label]
expected: FAIL
[TextTrack.label, \\u0000]
expected: FAIL

View file

@ -0,0 +1,9 @@
[language.html]
type: testharness
expected: ERROR
[TextTrack.language]
expected: FAIL
[TextTrack.language, \\u0000]
expected: FAIL

View file

@ -0,0 +1,8 @@
[mode.html]
type: testharness
[TextTrack.mode, wrong value]
expected: FAIL
[TextTrack.mode, correct value]
expected: FAIL

View file

@ -0,0 +1,9 @@
[oncuechange.html]
type: testharness
expected: ERROR
[TextTrack.oncuechange]
expected: FAIL
[TextTrack.addEventListener/removeEventListener]
expected: FAIL

View file

@ -0,0 +1,8 @@
[removeCue.html]
type: testharness
[TextTrack.removeCue(), two elementless tracks]
expected: FAIL
[TextTrack.removeCue(), cue from track element]
expected: FAIL

View file

@ -0,0 +1,9 @@
[endTime.html]
type: testharness
expected: ERROR
[TextTrackCue.endTime, script-created cue]
expected: FAIL
[TextTrackCue.endTime, parsed cue]
expected: FAIL

View file

@ -0,0 +1,9 @@
[id.html]
type: testharness
expected: ERROR
[TextTrackCue.id, script-created cue]
expected: FAIL
[TextTrackCue.id, parsed cue]
expected: FAIL

View file

@ -0,0 +1,9 @@
[onenter.html]
type: testharness
expected: ERROR
[TextTrackCue.onenter]
expected: FAIL
[TextTrackCue.addEventListener/removeEventListener]
expected: FAIL

View file

@ -0,0 +1,9 @@
[onexit.html]
type: testharness
expected: ERROR
[TextTrackCue.onexit]
expected: FAIL
[TextTrackCue.addEventListener/removeEventListener]
expected: FAIL

View file

@ -0,0 +1,9 @@
[pauseOnExit.html]
type: testharness
expected: ERROR
[TextTrackCue.pauseOnExit, script-created cue]
expected: FAIL
[TextTrackCue.pauseOnExit, parsed cue]
expected: FAIL

View file

@ -0,0 +1,9 @@
[startTime.html]
type: testharness
expected: ERROR
[TextTrackCue.startTime, script-created cue]
expected: FAIL
[TextTrackCue.startTime, parsed cue]
expected: FAIL

View file

@ -0,0 +1,9 @@
[track.html]
type: testharness
expected: ERROR
[TextTrackCue.track, script-created cue]
expected: FAIL
[TextTrackCue.track, parsed cue]
expected: FAIL

View file

@ -0,0 +1,14 @@
[getCueById.html]
type: testharness
[TextTrackCueList.getCueById, no id]
expected: FAIL
[TextTrackCueList.getCueById, id foo]
expected: FAIL
[TextTrackCueList.getCueById, no 1]
expected: FAIL
[TextTrackCueList.getCueById, id a\\u0000b]
expected: FAIL

View file

@ -0,0 +1,12 @@
[getter.html]
type: testharness
expected: ERROR
[TextTrackCueList getter]
expected: FAIL
[TextTrackCueList getter, no indexed set/create]
expected: FAIL
[TextTrackCueList getter, no indexed set/create (strict)]
expected: FAIL

View file

@ -0,0 +1,6 @@
[length.html]
type: testharness
expected: ERROR
[TextTrackCueList.length]
expected: FAIL

View file

@ -0,0 +1,5 @@
[getTrackById.html]
type: testharness
[TextTrackList.getTrackById]
expected: FAIL

View file

@ -0,0 +1,12 @@
[getter.html]
type: testharness
expected: ERROR
[TextTrackList getter]
expected: FAIL
[TextTrackList getter, no indexed set/create]
expected: FAIL
[TextTrackList getter, no indexed set/create (strict)]
expected: FAIL

View file

@ -0,0 +1,6 @@
[length.html]
type: testharness
expected: ERROR
[TextTrackList.length]
expected: FAIL

View file

@ -0,0 +1,8 @@
[onaddtrack.html]
type: testharness
[TextTrackList.onaddtrack]
expected: FAIL
[TextTrackList.addEventListener/removeEventListener]
expected: FAIL

View file

@ -0,0 +1,8 @@
[onremovetrack.html]
type: testharness
[TextTrackList.onremovetrack]
expected: FAIL
[TextTrackList.addEventListener/removeEventListener]
expected: FAIL

View file

@ -0,0 +1,8 @@
[constructor.html]
type: testharness
[TrackEvent constructor, one arg]
expected: FAIL
[TrackEvent constructor, two args]
expected: FAIL

View file

@ -0,0 +1,5 @@
[createEvent.html]
type: testharness
[TrackEvent created with createEvent]
expected: FAIL

View file

@ -0,0 +1,14 @@
[autoplay-overrides-preload.html]
type: testharness
[autoplay (set first) overrides preload "none"]
expected: FAIL
[autoplay (set last) overrides preload "none"]
expected: FAIL
[autoplay (set first) overrides preload "metadata"]
expected: FAIL
[autoplay (set last) overrides preload "metadata"]
expected: FAIL

View file

@ -0,0 +1,12 @@
[load-events-networkState.html]
type: testharness
expected: TIMEOUT
[NETWORK_IDLE]
expected: TIMEOUT
[NETWORK_LOADING]
expected: TIMEOUT
[NETWORK_NO_SOURCE]
expected: TIMEOUT

View file

@ -0,0 +1,9 @@
[load-removes-queued-error-event.html]
type: testharness
expected: TIMEOUT
[video error event]
expected: TIMEOUT
[source error event]
expected: TIMEOUT

View file

@ -0,0 +1,6 @@
[resource-selection-candidate-insert-before.html]
type: testharness
expected: TIMEOUT
[inserting another source before the candidate]
expected: TIMEOUT

View file

@ -0,0 +1,5 @@
[resource-selection-candidate-moved.html]
type: testharness
[moving the candidate source]
expected: FAIL

View file

@ -0,0 +1,6 @@
[resource-selection-candidate-remove-addEventListener.html]
type: testharness
expected: TIMEOUT
[removing the candidate source, addEventListener]
expected: TIMEOUT

View file

@ -0,0 +1,6 @@
[resource-selection-candidate-remove-onerror.html]
type: testharness
expected: TIMEOUT
[removing the candidate source, onerror]
expected: TIMEOUT

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-audio-constructor-no-src.html]
type: testharness
[NOT invoking resource selection with new Audio() sans src]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-audio-constructor.html]
type: testharness
[invoking resource selection with new Audio(src)]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-in-sync-event.html]
type: testharness
[await a stable state and sync event handlers]
expected: FAIL

View file

@ -0,0 +1,6 @@
[resource-selection-invoke-insert-into-iframe.html]
type: testharness
expected: TIMEOUT
[NOT invoking resource selection by inserting into other document with src set]
expected: TIMEOUT

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-insert-source-networkState.html]
type: testharness
[NOT invoking resource selection by inserting ]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-insert-source-not-in-document.html]
type: testharness
[invoking resource selection by inserting ]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-insert-source.html]
type: testharness
[invoking resource selection by inserting ]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-load.html]
type: testharness
[invoking resource selection with load()]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-pause-networkState.html]
type: testharness
[NOT invoking resource selection with pause() when networkState is not NETWORK_EMPTY]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-pause.html]
type: testharness
[invoking resource selection with pause()]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-play.html]
type: testharness
[invoking resource selection with play()]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-remove-from-document-networkState.html]
type: testharness
[NOT invoking resource selection with implicit pause() when networkState is not NETWORK_EMPTY]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-set-src-networkState.html]
type: testharness
[invoking load by setting src when networkState is not NETWORK_EMPTY]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-set-src-not-in-document.html]
type: testharness
[invoking load by setting src on video not in a document]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-invoke-set-src.html]
type: testharness
[invoking load by setting src]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-pointer-control.html]
type: testharness
[pointer updates (control test)]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-pointer-insert-br.html]
type: testharness
[pointer updates (adding br elements)]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-pointer-insert-source.html]
type: testharness
[pointer updates (adding source elements)]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-pointer-insert-text.html]
type: testharness
[pointer updates (adding text nodes)]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-pointer-remove-source-after.html]
type: testharness
[pointer updates (removing source element after pointer)]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-pointer-remove-source.html]
type: testharness
[pointer updates (removing source elements)]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-pointer-remove-text.html]
type: testharness
[pointer updates (removing text nodes)]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-remove-source.html]
type: testharness
[Changes to networkState when inserting and removing a ]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-remove-src.html]
type: testharness
[invoking resource selection by setting src; await stable state]
expected: FAIL

View file

@ -0,0 +1,5 @@
[resource-selection-source-media.html]
type: testharness
[the ]
expected: FAIL

View file

@ -0,0 +1,20 @@
[currentSrc.html]
type: testharness
[audio.currentSrc after adding source element with src attribute "."]
expected: FAIL
[audio.currentSrc after adding source element with src attribute " "]
expected: FAIL
[audio.currentSrc after adding source element with src attribute "data:,"]
expected: FAIL
[video.currentSrc after adding source element with src attribute "."]
expected: FAIL
[video.currentSrc after adding source element with src attribute " "]
expected: FAIL
[video.currentSrc after adding source element with src attribute "data:,"]
expected: FAIL

View file

@ -0,0 +1,152 @@
[canPlayType.html]
type: testharness
[application/octet-stream]
expected: FAIL
[video/x-new-fictional-format]
expected: FAIL
[audio/mp4 (optional)]
expected: FAIL
[audio/mp4; codecs="mp4a.40.2" (optional)]
expected: FAIL
[audio/mp4 with bogus codec]
expected: FAIL
[audio/ogg (optional)]
expected: FAIL
[audio/ogg; codecs="opus" (optional)]
expected: FAIL
[audio/ogg; codecs="vorbis" (optional)]
expected: FAIL
[audio/ogg with bogus codec]
expected: FAIL
[audio/wav (optional)]
expected: FAIL
[audio/wav; codecs="1" (optional)]
expected: FAIL
[audio/wav with bogus codec]
expected: FAIL
[audio/webm (optional)]
expected: FAIL
[audio/webm; codecs="opus" (optional)]
expected: FAIL
[audio/webm; codecs="vorbis" (optional)]
expected: FAIL
[audio/webm with bogus codec]
expected: FAIL
[video/3gpp (optional)]
expected: FAIL
[video/3gpp; codecs="samr" (optional)]
expected: FAIL
[video/3gpp; codecs="mp4v.20.8" (optional)]
expected: FAIL
[video/3gpp codecs subset]
expected: FAIL
[video/3gpp codecs order]
expected: FAIL
[video/3gpp with bogus codec]
expected: FAIL
[video/mp4 (optional)]
expected: FAIL
[video/mp4; codecs="mp4a.40.2" (optional)]
expected: FAIL
[video/mp4; codecs="avc1.42E01E" (optional)]
expected: FAIL
[video/mp4; codecs="avc1.4D401E" (optional)]
expected: FAIL
[video/mp4; codecs="avc1.58A01E" (optional)]
expected: FAIL
[video/mp4; codecs="avc1.64001E" (optional)]
expected: FAIL
[video/mp4; codecs="mp4v.20.8" (optional)]
expected: FAIL
[video/mp4; codecs="mp4v.20.240" (optional)]
expected: FAIL
[video/mp4 codecs subset]
expected: FAIL
[video/mp4 codecs order]
expected: FAIL
[video/mp4 with bogus codec]
expected: FAIL
[video/ogg (optional)]
expected: FAIL
[video/ogg; codecs="opus" (optional)]
expected: FAIL
[video/ogg; codecs="vorbis" (optional)]
expected: FAIL
[video/ogg; codecs="theora" (optional)]
expected: FAIL
[video/ogg codecs subset]
expected: FAIL
[video/ogg codecs order]
expected: FAIL
[video/ogg with bogus codec]
expected: FAIL
[video/webm (optional)]
expected: FAIL
[video/webm; codecs="opus" (optional)]
expected: FAIL
[video/webm; codecs="vorbis" (optional)]
expected: FAIL
[video/webm; codecs="vp8" (optional)]
expected: FAIL
[video/webm; codecs="vp8.0" (optional)]
expected: FAIL
[video/webm; codecs="vp9" (optional)]
expected: FAIL
[video/webm; codecs="vp9.0" (optional)]
expected: FAIL
[video/webm codecs subset]
expected: FAIL
[video/webm codecs order]
expected: FAIL
[video/webm with bogus codec]
expected: FAIL

View file

@ -0,0 +1,15 @@
[currentTime.html]
type: testharness
expected: TIMEOUT
[currentTime initial value]
expected: FAIL
[setting currentTime with a media controller present]
expected: FAIL
[setting currentTime when readyState is HAVE_NOTHING]
expected: FAIL
[setting currentTime when readyState is greater than HAVE_NOTHING]
expected: TIMEOUT

View file

@ -0,0 +1,9 @@
[paused_false_during_play.html]
type: testharness
expected: TIMEOUT
[audio.paused should be false during play event]
expected: NOTRUN
[video.paused should be false during play event]
expected: NOTRUN

View file

@ -0,0 +1,15 @@
[paused_true_during_pause.html]
type: testharness
expected: TIMEOUT
[audio events - paused property]
expected: FAIL
[audio.paused should be true during pause event]
expected: NOTRUN
[video events - paused property]
expected: FAIL
[video.paused should be true during pause event]
expected: NOTRUN

View file

@ -0,0 +1,5 @@
[pause-move-to-other-document.html]
type: testharness
[paused state when moving to other document]
expected: FAIL

View file

@ -0,0 +1,5 @@
[pause-move-within-document.html]
type: testharness
[paused state when moving within a document]
expected: FAIL

View file

@ -0,0 +1,5 @@
[pause-remove-from-document-networkState.html]
type: testharness
[paused state when removing from a document when networkState is NETWORK_EMPTY]
expected: FAIL

View file

@ -0,0 +1,5 @@
[pause-remove-from-document.html]
type: testharness
[paused state when removing from a document]
expected: FAIL

View file

@ -0,0 +1,5 @@
[play-in-detached-document.html]
type: testharness
[play() in detached document]
expected: FAIL

View file

@ -0,0 +1,9 @@
[playbackRate.html]
type: testharness
expected: TIMEOUT
[playbackRate initial value]
expected: FAIL
[setting playbackRate]
expected: TIMEOUT

View file

@ -0,0 +1,8 @@
[preload_reflects_none_autoplay.html]
type: testharness
[audio.preload - reflection test]
expected: FAIL
[video.preload - reflection test]
expected: FAIL

View file

@ -0,0 +1,32 @@
[autoplay.html]
type: testharness
[audio.autoplay]
expected: FAIL
[audio.autoplay and load()]
expected: FAIL
[audio.autoplay and play()]
expected: FAIL
[audio.autoplay and pause()]
expected: FAIL
[audio.autoplay and internal pause steps]
expected: FAIL
[video.autoplay]
expected: FAIL
[video.autoplay and load()]
expected: FAIL
[video.autoplay and play()]
expected: FAIL
[video.autoplay and pause()]
expected: FAIL
[video.autoplay and internal pause steps]
expected: FAIL

View file

@ -0,0 +1,6 @@
[seek-to-currentTime.html]
type: testharness
expected: TIMEOUT
[seek to currentTime]
expected: TIMEOUT

View file

@ -0,0 +1,6 @@
[seek-to-max-value.htm]
type: testharness
expected: TIMEOUT
[seek to Number.MAX_VALUE]
expected: TIMEOUT

Some files were not shown because too many files have changed in this diff Show more