diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 477491f351c6..e50d66994420 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -800,7 +800,7 @@ nsImageFrame::EnsureIntrinsicSizeAndRatio() // image request is null or image size not known, probably an // invalid image specified if (!(GetStateBits() & NS_FRAME_GENERATED_CONTENT)) { - bool imageBroken = false; + bool imageInvalid = false; // check for broken images. valid null images (eg. img src="") are // not considered broken because they have no image requests nsCOMPtr imageLoader = do_QueryInterface(mContent); @@ -808,14 +808,21 @@ nsImageFrame::EnsureIntrinsicSizeAndRatio() nsCOMPtr currentRequest; imageLoader->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST, getter_AddRefs(currentRequest)); - uint32_t imageStatus; - imageBroken = - currentRequest && - NS_SUCCEEDED(currentRequest->GetImageStatus(&imageStatus)) && - (imageStatus & imgIRequest::STATUS_ERROR); + if (currentRequest) { + uint32_t imageStatus; + imageInvalid = + NS_SUCCEEDED(currentRequest->GetImageStatus(&imageStatus)) && + (imageStatus & imgIRequest::STATUS_ERROR); + } else { + // check if images are user-disabled (or blocked for other + // reasons) + int16_t imageBlockingStatus; + imageLoader->GetImageBlockingStatus(&imageBlockingStatus); + imageInvalid = imageBlockingStatus != nsIContentPolicy::ACCEPT; + } } // invalid image specified. make the image big enough for the "broken" icon - if (imageBroken) { + if (imageInvalid) { nscoord edgeLengthToUse = nsPresContext::CSSPixelsToAppUnits( ICON_SIZE + (2 * (ICON_PADDING + ALT_BORDER_WIDTH)));