Bug 1096089: Make end argument an unrestricted double as per spec. r=cajbir r=bholley

Also, test for updating value before testing for duration and start, as per
spec: http://w3c.github.io/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end
This commit is contained in:
Jean-Yves Avenard 2015-02-25 20:35:44 +11:00
parent ec632c2fe5
commit 51526ba4db
3 changed files with 5 additions and 11 deletions

View File

@ -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);
}

View File

@ -40,5 +40,5 @@ interface SourceBuffer : EventTarget {
[Throws]
void abort();
[Throws]
void remove(double start, double end);
void remove(double start, unrestricted double end);
};

View File

@ -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