We currently render the broken image icon for missing CSS images (backgrounds, border-image etc) but I don't think we should. I think we should only show it for content images.
(In reply to Simon Fraser (smfr) from comment #0) > We currently render the broken image icon for missing CSS images > (backgrounds, border-image etc) but I don't think we should. I think we > should only show it for content images. How can this happen? Can you include a test case? In RenderBoxModelObject::paintFillLayerExtended() we check: bool shouldPaintBackgroundImage = bgImage && bgImage->canRender(this, style().effectiveZoom()); If the image is missing, bgImage will be null. And if an error happens while loading or decoding the image, bgImage->canRender() will return false. In both cases drawing the background image step will be skipped.
I think I was seeing this for border-image.
*** Bug 231078 has been marked as a duplicate of this bug. ***
(In reply to Simon Fraser (smfr) from comment #2) > I think I was seeing this for border-image. Bug 206909 was caused by us rendering `content: -webkit-image-set(url(...))` given an invalid image.
<rdar://problem/82999675>
I can't figure out how to reproduce this now.
This is one way: background-image: -webkit-cross-fade(url('http://www.example.com/broken.png'), url('http://www.example.com/broken.png'), 50%); I think it's bad that CachedImage::image() and CachedImage::imageForRenderer() can return the broken image icon. That causes hilarity like consulting this image for it's opaqueness, or EXIF orientation, even if it's never used in this context (e.g. CSS backgrounds).
Created attachment 441689 [details] Some examples
(In reply to Simon Fraser (smfr) from comment #6) > I can't figure out how to reproduce this now. content: -webkit-image-set(url('http://www.example.com/broken.png') 1x); still suffices too should really go through and add a whole bunch of WPT tests for this, in the various places where <image> is used as the value
<rdar://problem/84026868>
The images level 4 spec introduced the concept of an invalid image: http://w3c.github.io/csswg-drafts/css-images-4/#invalid-image I implemented this as a StyleInvalidImage for use in image-set in 261015@main Maybe this is useful in the contexts described in this bug too?