From 3b224b2b26a553e575ebee805e3cc74c8f35e4b3 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 22 Oct 2020 20:43:08 +0000 Subject: [DOM] When failing to create a channel and an image request, make sure to set the image blocking status appropriately. This is the same status as we do for known no-data protocols and ensures we treat these two cases the same. --- dom/base/nsImageLoadingContent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dom') diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp index 7ddc2184b..1226ef22e 100644 --- a/dom/base/nsImageLoadingContent.cpp +++ b/dom/base/nsImageLoadingContent.cpp @@ -932,8 +932,12 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI, 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) + if (!mCurrentRequest) { mCurrentURI = aNewURI; + if (mImageBlockingStatus == nsIContentPolicy::ACCEPT) { + mImageBlockingStatus = nsIContentPolicy::REJECT_REQUEST; + } + } FireEvent(NS_LITERAL_STRING("error")); FireEvent(NS_LITERAL_STRING("loadend")); -- cgit v1.2.3