Bug 1297156: Fire an error event to xul:image elements when the attempt to load an image fails synchronously.
When the attempt to load an image returns a failure we need to dispatch an
error event to the xul element.
MozReview-Commit-ID: BpWMTy4peOG
--- a/layout/xul/nsImageBoxFrame.cpp
+++ b/layout/xul/nsImageBoxFrame.cpp
@@ -253,17 +253,19 @@ nsImageBoxFrame::UpdateImage()
requestContextID,
doc->GetDocumentURI(),
doc->GetReferrerPolicy(),
mListener, mLoadFlags,
EmptyString(),
getter_AddRefs(mImageRequest),
contentPolicyType);
- if (NS_SUCCEEDED(rv) && mImageRequest) {
+ if (NS_FAILED(rv)) {
+ FireImageDOMEvent(mContent, eLoadError);
+ } else if (mImageRequest) {
nsLayoutUtils::RegisterImageRequestIfAnimated(presContext,
mImageRequest,
&mRequestRegistered);
}
}
}
} else {
// Only get the list-style-image if we aren't being drawn