diff --git a/dom/media/mediasource/SourceBuffer.cpp b/dom/media/mediasource/SourceBuffer.cpp index cde96d070e5a..4f4e0b7509e1 100644 --- a/dom/media/mediasource/SourceBuffer.cpp +++ b/dom/media/mediasource/SourceBuffer.cpp @@ -252,16 +252,16 @@ SourceBuffer::Remove(double aStart, double aEnd, ErrorResult& aRv) aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; } + if (mUpdating) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return; + } if (IsNaN(mMediaSource->Duration()) || aStart < 0 || aStart > mMediaSource->Duration() || aEnd <= aStart || IsNaN(aEnd)) { aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR); return; } - if (mUpdating) { - aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); - return; - } if (mMediaSource->ReadyState() == MediaSourceReadyState::Ended) { mMediaSource->SetReadyState(MediaSourceReadyState::Open); } diff --git a/dom/webidl/SourceBuffer.webidl b/dom/webidl/SourceBuffer.webidl index 3e3e6602c5d2..aaae3e412ddc 100644 --- a/dom/webidl/SourceBuffer.webidl +++ b/dom/webidl/SourceBuffer.webidl @@ -40,5 +40,5 @@ interface SourceBuffer : EventTarget { [Throws] void abort(); [Throws] - void remove(double start, double end); + void remove(double start, unrestricted double end); }; diff --git a/testing/web-platform/meta/media-source/mediasource-remove.html.ini b/testing/web-platform/meta/media-source/mediasource-remove.html.ini index 0859573d9747..00dfbf645bd5 100644 --- a/testing/web-platform/meta/media-source/mediasource-remove.html.ini +++ b/testing/web-platform/meta/media-source/mediasource-remove.html.ini @@ -12,12 +12,6 @@ [Test removing the end of appended data.] expected: FAIL - [Test remove with a NEGATIVE_INFINITY end.] - expected: FAIL - - [Test remove with a NaN end.] - expected: FAIL - [Test remove with a start at the duration.] expected: if (os == "win") and (version != "5.1.2600"): FAIL