Bug 1458673 - In start and stop methods of AudioBufferSourceNode change the throw error to align with the spec. r=dminor

MozReview-Commit-ID: 7CwazXg1JWm

--HG--
extra : rebase_source : 5c84a5a652d8114c0fe99db584a63732b3ffd420
This commit is contained in:
Alex Chronopoulos 2018-05-03 11:40:34 +02:00
Родитель 74fd7bec28
Коммит 16cac69ac6
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -702,9 +702,9 @@ void
AudioBufferSourceNode::Start(double aWhen, double aOffset,
const Optional<double>& aDuration, ErrorResult& aRv)
{
if (!WebAudioUtils::IsTimeValid(aWhen) ||
if (!WebAudioUtils::IsTimeValid(aWhen) || aOffset < 0 ||
(aDuration.WasPassed() && !WebAudioUtils::IsTimeValid(aDuration.Value()))) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
aRv.Throw(NS_ERROR_RANGE_ERR);
return;
}
@ -805,7 +805,7 @@ void
AudioBufferSourceNode::Stop(double aWhen, ErrorResult& aRv)
{
if (!WebAudioUtils::IsTimeValid(aWhen)) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
aRv.Throw(NS_ERROR_RANGE_ERR);
return;
}