зеркало из https://github.com/mozilla/pjs.git
Fixing bug 269125. Make image.onerror fire for non-existent files. Patch by trev@gtchat.de, r=jst@mozilla.org, sr=bzbarsky@mit.edu
This commit is contained in:
Родитель
9e4767d66b
Коммит
87858f62d4
|
@ -398,6 +398,7 @@ nsImageLoadingContent::ImageURIChanged(const nsAString& aNewURI,
|
|||
PRBool aForce)
|
||||
{
|
||||
if (!mLoadingEnabled) {
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -454,6 +455,7 @@ nsImageLoadingContent::ImageURIChanged(const nsAString& aNewURI,
|
|||
|
||||
if (!loadImage) {
|
||||
// Don't actually load anything! This was blocked by CanLoadImage.
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -473,6 +475,11 @@ nsImageLoadingContent::ImageURIChanged(const nsAString& aNewURI,
|
|||
rv = nsContentUtils::LoadImage(imageURI, doc, doc->GetDocumentURI(),
|
||||
this, nsIRequest::LOAD_NORMAL,
|
||||
getter_AddRefs(req));
|
||||
if (NS_FAILED(rv)) {
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// If we now have a current request, we don't need to store the URI, since
|
||||
// we can get it off the request. Release it.
|
||||
if (mCurrentRequest) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче