зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1302632: P1. Set proper error code when readyState is HAVE_NOTHING. r=jwwang
MozReview-Commit-ID: CMQkW5pPDF2 --HG-- extra : rebase_source : f0286af0b2daa2f91bbea66ab7bcf6de1a6d2207
This commit is contained in:
Родитель
7b00b004c4
Коммит
8a54c1a711
|
@ -1042,9 +1042,6 @@ void HTMLMediaElement::AbortExistingLoads()
|
|||
|
||||
void HTMLMediaElement::NoSupportedMediaSourceError()
|
||||
{
|
||||
NS_ASSERTION(mNetworkState == NETWORK_LOADING,
|
||||
"Not loading during source selection?");
|
||||
|
||||
mError = new MediaError(this, MEDIA_ERR_SRC_NOT_SUPPORTED);
|
||||
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_NO_SOURCE);
|
||||
DispatchAsyncEvent(NS_LITERAL_STRING("error"));
|
||||
|
@ -4416,7 +4413,11 @@ void HTMLMediaElement::NetworkError()
|
|||
if (mDecoder) {
|
||||
ShutdownDecoder();
|
||||
}
|
||||
Error(MEDIA_ERR_NETWORK);
|
||||
if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) {
|
||||
NoSupportedMediaSourceError();
|
||||
} else {
|
||||
Error(MEDIA_ERR_NETWORK);
|
||||
}
|
||||
}
|
||||
|
||||
void HTMLMediaElement::DecodeError(const MediaResult& aError)
|
||||
|
@ -4442,6 +4443,8 @@ void HTMLMediaElement::DecodeError(const MediaResult& aError)
|
|||
} else {
|
||||
NS_WARNING("Should know the source we were loading from!");
|
||||
}
|
||||
} else if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) {
|
||||
NoSupportedMediaSourceError();
|
||||
} else {
|
||||
Error(MEDIA_ERR_DECODE, aError);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче