<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>203788</bug_id>
          
          <creation_ts>2019-11-02 12:25:46 -0700</creation_ts>
          <short_desc>Don&apos;t show the broken image icon for missing CSS images</short_desc>
          <delta_ts>2023-05-22 09:07:27 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Images</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>229909</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>gsnedders</cc>
    
    <cc>rreno</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1586761</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2019-11-02 12:25:46 -0700</bug_when>
    <thetext>We currently render the broken image icon for missing CSS images (backgrounds, border-image etc) but I don&apos;t think we should. I think we should only show it for content images.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1587037</commentid>
    <comment_count>1</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2019-11-04 10:10:39 -0800</bug_when>
    <thetext>(In reply to Simon Fraser (smfr) from comment #0)
&gt; We currently render the broken image icon for missing CSS images
&gt; (backgrounds, border-image etc) but I don&apos;t think we should. I think we
&gt; 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 &amp;&amp; bgImage-&gt;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-&gt;canRender() will return false. In both cases drawing the background image step will be skipped.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1587048</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2019-11-04 10:27:38 -0800</bug_when>
    <thetext>I think I was seeing this for border-image.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803045</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-10-12 02:42:31 -0700</bug_when>
    <thetext>*** Bug 231078 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803050</commentid>
    <comment_count>4</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-10-12 02:48:13 -0700</bug_when>
    <thetext>(In reply to Simon Fraser (smfr) from comment #2)
&gt; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803134</commentid>
    <comment_count>5</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-10-12 08:44:10 -0700</bug_when>
    <thetext>&lt;rdar://problem/82999675&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1805876</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2021-10-18 21:16:30 -0700</bug_when>
    <thetext>I can&apos;t figure out how to reproduce this now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1805882</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2021-10-18 21:40:31 -0700</bug_when>
    <thetext>This is one way:
            background-image: -webkit-cross-fade(url(&apos;http://www.example.com/broken.png&apos;), url(&apos;http://www.example.com/broken.png&apos;), 50%);

I think it&apos;s bad that CachedImage::image() and CachedImage::imageForRenderer() can return the broken image icon. That causes hilarity like consulting this image for it&apos;s opaqueness, or EXIF orientation, even if it&apos;s never used in this context (e.g. CSS backgrounds).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1805884</commentid>
    <comment_count>8</comment_count>
      <attachid>441689</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2021-10-18 22:00:42 -0700</bug_when>
    <thetext>Created attachment 441689
Some examples</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1805952</commentid>
    <comment_count>9</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-10-19 05:30:03 -0700</bug_when>
    <thetext>(In reply to Simon Fraser (smfr) from comment #6)
&gt; I can&apos;t figure out how to reproduce this now.

content: -webkit-image-set(url(&apos;http://www.example.com/broken.png&apos;) 1x); still suffices too

should really go through and add a whole bunch of WPT tests for this, in the various places where &lt;image&gt; is used as the value</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1909279</commentid>
    <comment_count>10</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-10-31 03:46:41 -0700</bug_when>
    <thetext>&lt;rdar://problem/84026868&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1956966</commentid>
    <comment_count>11</comment_count>
    <who name="Ryan Reno">rreno</who>
    <bug_when>2023-05-22 09:07:27 -0700</bug_when>
    <thetext>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?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>441689</attachid>
            <date>2021-10-18 22:00:42 -0700</date>
            <delta_ts>2021-10-18 22:00:42 -0700</delta_ts>
            <desc>Some examples</desc>
            <filename>broken-css-images.html</filename>
            <type>text/html</type>
            <size>983</size>
            <attacher name="Simon Fraser (smfr)">simon.fraser</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KICAgIDxtZXRhIG5hbWU9InZpZXdwb3J0IiBj
b250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgsIGluaXRpYWwtc2NhbGU9MSwgc2hyaW5rLXRvLWZp
dD1ubyI+CiAgICA8c3R5bGU+CiAgICAgICAgLmJveCB7CiAgICAgICAgICAgIHdpZHRoOiAyMDBw
eDsKICAgICAgICAgICAgaGVpZ2h0OiAyMDBweDsKICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xv
cjogc2lsdmVyOwogICAgICAgICAgICBmb250LXNpemU6IDEwMHB4OwogICAgICAgICAgICBtYXJn
aW46IDIwcHg7CiAgICAgICAgfQogICAgICAgIAogICAgICAgIGltZyB7CiAgICAgICAgICAgIHdp
ZHRoOiAxMDBweDsKICAgICAgICAgICAgaGVpZ2h0OiAxMDBweDsKICAgICAgICB9CiAgICAgICAg
CiAgICAgICAgLmNyb3NzZmFkZSB7CiAgICAgICAgICAgIGJhY2tncm91bmQtaW1hZ2U6IC13ZWJr
aXQtY3Jvc3MtZmFkZSh1cmwoJ2h0dHA6Ly93d3cuZXhhbXBsZS5jb20vYnJva2VuLnBuZycpLCB1
cmwoJ2h0dHA6Ly93d3cuZXhhbXBsZS5jb20vYnJva2VuLnBuZycpLCA1MCUpOwogICAgICAgIH0K
CiAgICAgICAgLmZpbHRlciB7CiAgICAgICAgICAgIGJhY2tncm91bmQtaW1hZ2U6IGZpbHRlcih1
cmwoJ2h0dHA6Ly93d3cuZXhhbXBsZS5jb20vYnJva2VuLnBuZycpLCBzYXR1cmF0ZSgwLjUpKTsK
ICAgICAgICB9CiAgICA8L3N0eWxlPgo8L2hlYWQ+Cjxib2R5PgogICAgCiAgICA8aDE+aW1hZ2Ug
ZWxlbWVudDwvaDE+CiAgICA8aW1nIGlkPSJicm9rZW4taW1hZ2UiIHNyYz0iaHR0cDovL3d3dy5l
eGFtcGxlLmNvbS9icm9rZW4ucG5nIj4KICAgIAogICAgPGgxPmNyb3NzIGZhZGUgaW1hZ2U8L2gx
PgogICAgPGRpdiBjbGFzcz0iY3Jvc3NmYWRlIGJveCI+PC9kaXY+CgogICAgPGgxPmZpbHRlciBp
bWFnZTwvaDE+CiAgICA8ZGl2IGNsYXNzPSJmaWx0ZXIgYm94Ij48L2Rpdj4KICAgIAogICAgCjwv
Ym9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>