<?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>31630</bug_id>
          
          <creation_ts>2009-11-18 09:47:46 -0800</creation_ts>
          <short_desc>Avoid downloading CSS background images that will never be visible</short_desc>
          <delta_ts>2010-02-14 14:26:42 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>24223</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anthony Ricaud">rik</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>hugues.lismonde</cc>
    
    <cc>hyatt</cc>
    
    <cc>laszlo.gombos</cc>
    
    <cc>martinklepsch</cc>
    
    <cc>mitz</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>164606</commentid>
    <comment_count>0</comment_count>
      <attachid>43437</attachid>
    <who name="Anthony Ricaud">rik</who>
    <bug_when>2009-11-18 09:47:46 -0800</bug_when>
    <thetext>Created attachment 43437
Testcase

1. Open the attached testcase
2. Check in the Resources panel or in the Activity window

Actual result:
The image was downloaded

Expected result:
The image wasn&apos;t downloaded

Without this behavior, the CSS gradients are less useful since you still download a useless image.

Firefox3.6beta3 is not downloading the image.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>165032</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-11-19 11:24:17 -0800</bug_when>
    <thetext>Hyatt has long been our &quot;what images need to be loaded&quot; strategist. In general there are images and stylesheets and other objects you might wish to not load that need to be loaded to support &quot;preloading&quot; behavior expected by websites or other correctness issues. But obviously, not loading things is *way* better for performance.

Hyatt, can you weigh in on this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>167733</commentid>
    <comment_count>2</comment_count>
      <attachid>44099</attachid>
    <who name="Martin Klepsch">martinklepsch</who>
    <bug_when>2009-12-01 13:56:34 -0800</bug_when>
    <thetext>Created attachment 44099
Shows how an with &quot;! important&quot; overwritten image gets loaded.

when forcing backgound-image: none; with !important any background-image declaration after that one should be ignored therfore the images should not get downloaded to the client.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>167737</commentid>
    <comment_count>3</comment_count>
      <attachid>44100</attachid>
    <who name="Martin Klepsch">martinklepsch</who>
    <bug_when>2009-12-01 14:09:39 -0800</bug_when>
    <thetext>Created attachment 44100
Shows how an regulary overwritten image gets loaded.

this shows that images that are overwritten simply by a second background assignment are also loaded.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>167743</commentid>
    <comment_count>4</comment_count>
    <who name="Martin Klepsch">martinklepsch</who>
    <bug_when>2009-12-01 14:18:09 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; Hyatt has long been our &quot;what images need to be loaded&quot; strategist. In general
&gt; there are images and stylesheets and other objects you might wish to not load
&gt; that need to be loaded to support &quot;preloading&quot; behavior expected by websites or
&gt; other correctness issues. But obviously, not loading things is *way* better for
&gt; performance.
&gt; 
&gt; Hyatt, can you weigh in on this?

i think it&apos;s okay to load images that are just not visible at the beginning (icons for js flash messages for example) but loading images that are overwritten by another property declaration is unneeded.
maybe i&apos;m wrong but i&apos;ve never seen something like this in js: 
removing a second property declaration in order to make the first declaration used by the browser to render the page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>186558</commentid>
    <comment_count>5</comment_count>
    <who name="Hugues Lismonde">hugues.lismonde</who>
    <bug_when>2010-02-01 13:48:15 -0800</bug_when>
    <thetext>I&apos;ll vote for this one too. Overridden background-image should never be downloaded, as Anthony said, it defeats the purpose of using graceful degradation with gradients, shadows, ... (but &quot;invisible&quot; background images should definitively be downloaded/prefetched).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>190352</commentid>
    <comment_count>6</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2010-02-14 14:24:54 -0800</bug_when>
    <thetext>Yes, this is just a bug.  I think it&apos;s already been filed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>190353</commentid>
    <comment_count>7</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2010-02-14 14:26:42 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 24223 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>43437</attachid>
            <date>2009-11-18 09:47:46 -0800</date>
            <delta_ts>2009-11-18 09:47:46 -0800</delta_ts>
            <desc>Testcase</desc>
            <filename>gradient.html</filename>
            <type>text/html</type>
            <size>302</size>
            <attacher name="Anthony Ricaud">rik</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxzdHlsZT4KYm9keSB7CiAgICBoZWlnaHQ6IDQwMHB4OwogICAgYmFj
a2dyb3VuZDogdXJsKGh0dHA6Ly93ZWJraXQub3JnL2ltYWdlcy9ncmVlbi1iYWNrZ3JvdW5kLnBu
Zyk7CiAgICBiYWNrZ3JvdW5kOiAtd2Via2l0LWdyYWRpZW50KGxpbmVhciwgbGVmdCB0b3AsIGxl
ZnQgYm90dG9tLCBmcm9tKCMyODEpLCB0byh3aGl0ZSkpIG5vLXJlcGVhdDsKICAgIGJhY2tncm91
bmQ6IC1tb3otbGluZWFyLWdyYWRpZW50KCMyODEsIHdoaXRlKSBuby1yZXBlYXQ7Cn0KPC9zdHls
ZT4KPGJvZHk+PC9ib2R5Pgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>44099</attachid>
            <date>2009-12-01 13:56:34 -0800</date>
            <delta_ts>2009-12-01 13:56:34 -0800</delta_ts>
            <desc>Shows how an with &quot;! important&quot; overwritten image gets loaded.</desc>
            <filename>url.txt</filename>
            <type>text/plain</type>
            <size>45</size>
            <attacher name="Martin Klepsch">martinklepsch</attacher>
            
              <data encoding="base64">aHR0cDovL2V4cGVyaW1lbnRzLm1hcnRpLmluL3JnYmFfcGVyZm9ybWFuY2Uv
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>44100</attachid>
            <date>2009-12-01 14:09:39 -0800</date>
            <delta_ts>2009-12-01 14:09:39 -0800</delta_ts>
            <desc>Shows how an regulary overwritten image gets loaded.</desc>
            <filename>url.txt</filename>
            <type>text/plain</type>
            <size>66</size>
            <attacher name="Martin Klepsch">martinklepsch</attacher>
            
              <data encoding="base64">aHR0cDovL2V4cGVyaW1lbnRzLm1hcnRpLmluL3JnYmFfcGVyZm9ybWFuY2UvcmVndWxhck92ZXJ3
cml0ZS5odG1s
</data>

          </attachment>
      

    </bug>

</bugzilla>