Bug 1658881 - When failing to create a channel and an image request, make sure to set the image blocking status appropriately. r=tnikkel
This is the same status as we do for known no-data protocols here: https://searchfox.org/mozilla-central/rev/ac142717cc067d875e83e4b1316f004f6e063a46/dom/base/nsNoDataProtocolContentPolicy.cpp#59 This ensures we treat these two cases the same. Differential Revision: https://phabricator.services.mozilla.com/D89382
This commit is contained in:
@@ -1211,7 +1211,12 @@ nsresult nsImageLoadingContent::LoadImage(nsIURI* aNewURI, bool aForce,
|
||||
MOZ_ASSERT(!req, "Shouldn't have non-null request here");
|
||||
// If we don't have a current URI, we might as well store this URI so people
|
||||
// know what we tried (and failed) to load.
|
||||
if (!mCurrentRequest) mCurrentURI = aNewURI;
|
||||
if (!mCurrentRequest) {
|
||||
mCurrentURI = aNewURI;
|
||||
if (mImageBlockingStatus == nsIContentPolicy::ACCEPT) {
|
||||
mImageBlockingStatus = nsIContentPolicy::REJECT_REQUEST;
|
||||
}
|
||||
}
|
||||
|
||||
FireEvent(u"error"_ns);
|
||||
FireEvent(u"loadend"_ns);
|
||||
|
||||
Reference in New Issue
Block a user