mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
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:
parent
ec632c2fe5
commit
51526ba4db
@ -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);
|
||||
}
|
||||
|
@ -40,5 +40,5 @@ interface SourceBuffer : EventTarget {
|
||||
[Throws]
|
||||
void abort();
|
||||
[Throws]
|
||||
void remove(double start, double end);
|
||||
void remove(double start, unrestricted double end);
|
||||
};
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user