Make sure we do not skip the HaveMetadata state. Fixes a bunch of tests

This commit is contained in:
Fernando Jiménez Moreno 2018-10-03 20:39:19 +02:00
parent 6b0acc9cd8
commit 11ac049d27
5 changed files with 21 additions and 0 deletions

View file

@ -1314,6 +1314,11 @@ impl FetchResponseListener for HTMLMediaElementContext {
}
if status.is_ok() {
if elem.ready_state.get() == ReadyState::HaveNothing {
// Make sure that we don't skip the HaveMetadata and HaveCurrentData
// states for short streams.
elem.change_ready_state(ReadyState::HaveMetadata);
}
elem.change_ready_state(ReadyState::HaveEnoughData);
elem.upcast::<EventTarget>().fire_event(atom!("progress"));