<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 5e speculative background images</title>
	<atom:link href="http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/</link>
	<description>Essential knowledge for making your web pages faster.</description>
	<lastBuildDate>Wed, 08 Sep 2010 10:04:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Stefan W</title>
		<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/comment-page-1/#comment-1633</link>
		<dc:creator>Stefan W</dc:creator>
		<pubDate>Wed, 17 Feb 2010 12:43:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevesouders.com/blog/?p=911#comment-1633</guid>
		<description>Another add to that:
When Opera parses a background declaration and encounters -moz- or -webkit-gradients it will still interpret the parts it understands (e.g. color), instead of throwing the declaration away completely and using a previous one like it should. That&#039;s why I had to split my background declaration into its parts:
    background-color: #d9d9d9;
    background-position: 0px 0px;
    background-repeat: no-repeat;
    background-image: url(&quot;../img/background.png&quot;);
    background-image:-webkit-gradient(radial, 15% 30, 500, 30% 30, 0, from(#d9d9d9), to(#fff));
    background-image:-moz-radial-gradient(25% 30px, circle cover, #fff 0%, #d9d9d9 500px);
    /* Fail for Webkit: downloads background image even though it doesn&#039;t need it, Firefox 3.6 is more clever 
     Also fail for Opera: it doesn&#039;t know -moz- or -webkit-gradients but interprets the part of a 
    background-declaration it understands instead of throwing it away and using the previous declaration */</description>
		<content:encoded><![CDATA[<p>Another add to that:<br />
When Opera parses a background declaration and encounters -moz- or -webkit-gradients it will still interpret the parts it understands (e.g. color), instead of throwing the declaration away completely and using a previous one like it should. That&#8217;s why I had to split my background declaration into its parts:<br />
    background-color: #d9d9d9;<br />
    background-position: 0px 0px;<br />
    background-repeat: no-repeat;<br />
    background-image: url(&#8220;../img/background.png&#8221;);<br />
    background-image:-webkit-gradient(radial, 15% 30, 500, 30% 30, 0, from(#d9d9d9), to(#fff));<br />
    background-image:-moz-radial-gradient(25% 30px, circle cover, #fff 0%, #d9d9d9 500px);<br />
    /* Fail for Webkit: downloads background image even though it doesn&#8217;t need it, Firefox 3.6 is more clever<br />
     Also fail for Opera: it doesn&#8217;t know -moz- or -webkit-gradients but interprets the part of a<br />
    background-declaration it understands instead of throwing it away and using the previous declaration */</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/comment-page-1/#comment-1626</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Tue, 16 Feb 2010 15:59:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevesouders.com/blog/?p=911#comment-1626</guid>
		<description>I&#039;ve recently been playing with CSS gradients.  For old browsers, I would declare a background image that simulated the gradient I wanted, then overwrite it with the gradient:

#el {
background: red url(gradient.png);
background: -webkit-gradient(...);
background: -moz-linear-gradient(...);
background: linear-gradient(...);
}

I noticed Safari was downloading gradient.png, even though it wasn&#039;t using it.  To get around this, I had to use Modernizr (with some slight modifications) to target different capabilities:

.nojs #el, .no-cssgradients #el {
background: red url(gradient.png);
}

.cssgradients #el {
background: -webkit-gradient(...);
background: -moz-linear-gradient(...);
background: linear-gradient(...);
}

I don&#039;t like that it has to be done that way, but some of the gradient files were big enough that I ONLY wanted users to get them if they didn&#039;t have another option.

The spam blocker is asking me the answer to &quot;for times 6&quot;.  I&#039;m assuming it meant &quot;four&quot;, or the question makes no sense at all.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve recently been playing with CSS gradients.  For old browsers, I would declare a background image that simulated the gradient I wanted, then overwrite it with the gradient:</p>
<p>#el {<br />
background: red url(gradient.png);<br />
background: -webkit-gradient(&#8230;);<br />
background: -moz-linear-gradient(&#8230;);<br />
background: linear-gradient(&#8230;);<br />
}</p>
<p>I noticed Safari was downloading gradient.png, even though it wasn&#8217;t using it.  To get around this, I had to use Modernizr (with some slight modifications) to target different capabilities:</p>
<p>.nojs #el, .no-cssgradients #el {<br />
background: red url(gradient.png);<br />
}</p>
<p>.cssgradients #el {<br />
background: -webkit-gradient(&#8230;);<br />
background: -moz-linear-gradient(&#8230;);<br />
background: linear-gradient(&#8230;);<br />
}</p>
<p>I don&#8217;t like that it has to be done that way, but some of the gradient files were big enough that I ONLY wanted users to get them if they didn&#8217;t have another option.</p>
<p>The spam blocker is asking me the answer to &#8220;for times 6&#8243;.  I&#8217;m assuming it meant &#8220;four&#8221;, or the question makes no sense at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Roussey</title>
		<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/comment-page-1/#comment-1610</link>
		<dc:creator>Steven Roussey</dc:creator>
		<pubDate>Mon, 15 Feb 2010 19:55:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevesouders.com/blog/?p=911#comment-1610</guid>
		<description>I consider #3 a bug. In some situations, say using a complex JS UI framework like ExtJS, there will be a premade CSS design that devs will use and then modify. Now, while I agree that a large site with the right resources should not rely on CSS cascading for this purpose, I don&#039;t think those with lesser resources should be punished in this way.

I still think a manifest file, similar to that used for offline, should be provided by a website to optionally give the preferred order of downloading assets (both those that can be found from a static analysis of html, css, etc., as well as those that the site dev knows will be needed dynamically at a later point in time).</description>
		<content:encoded><![CDATA[<p>I consider #3 a bug. In some situations, say using a complex JS UI framework like ExtJS, there will be a premade CSS design that devs will use and then modify. Now, while I agree that a large site with the right resources should not rely on CSS cascading for this purpose, I don&#8217;t think those with lesser resources should be punished in this way.</p>
<p>I still think a manifest file, similar to that used for offline, should be provided by a website to optionally give the preferred order of downloading assets (both those that can be found from a static analysis of html, css, etc., as well as those that the site dev knows will be needed dynamically at a later point in time).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/comment-page-1/#comment-1605</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Sun, 14 Feb 2010 23:51:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevesouders.com/blog/?p=911#comment-1605</guid>
		<description>To offer a reasonable use for item #3, I propose the following:

a { backgound: url(hover.gif); }
a:link { background: url(link.gif); }
a:hover { background: url(hover.gif); }

With the above rules, the hover image would be pre-fetched for the hover event and prevent the lag in rendering the new background image on hover. The same prefetch behavior could be used another way:

button { background:url(hover.gif); }
button { background:url(button.gif); }
button:hover { background:url(hover.gif); }</description>
		<content:encoded><![CDATA[<p>To offer a reasonable use for item #3, I propose the following:</p>
<p>a { backgound: url(hover.gif); }<br />
a:link { background: url(link.gif); }<br />
a:hover { background: url(hover.gif); }</p>
<p>With the above rules, the hover image would be pre-fetched for the hover event and prevent the lag in rendering the new background image on hover. The same prefetch behavior could be used another way:</p>
<p>button { background:url(hover.gif); }<br />
button { background:url(button.gif); }<br />
button:hover { background:url(hover.gif); }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Freddy</title>
		<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/comment-page-1/#comment-1604</link>
		<dc:creator>Freddy</dc:creator>
		<pubDate>Sun, 14 Feb 2010 22:22:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevesouders.com/blog/?p=911#comment-1604</guid>
		<description>To add a real-world case where this is relevant: A web application styled with a default stylesheet containing default background images, and a per-client customized stylesheet (&quot;skin&quot;) containing branding graphics etc later in the stylesheet chain.

I am currently working on exactly that. Thank you, you make a very good point about wasting bandwidth, especially in conjunction with image preloading scripts. I shall store the default styling, at least as far as it is superseded by client-specific styles, into a separate stylesheet.</description>
		<content:encoded><![CDATA[<p>To add a real-world case where this is relevant: A web application styled with a default stylesheet containing default background images, and a per-client customized stylesheet (&#8220;skin&#8221;) containing branding graphics etc later in the stylesheet chain.</p>
<p>I am currently working on exactly that. Thank you, you make a very good point about wasting bandwidth, especially in conjunction with image preloading scripts. I shall store the default styling, at least as far as it is superseded by client-specific styles, into a separate stylesheet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris</title>
		<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/comment-page-1/#comment-1601</link>
		<dc:creator>Boris</dc:creator>
		<pubDate>Sun, 14 Feb 2010 18:25:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevesouders.com/blog/?p=911#comment-1601</guid>
		<description>For what it&#039;s worth, on item #3 Gecko had the current Webkit behavior for a bit, and we considered it a bug that we did so (https://bugzilla.mozilla.org/show_bug.cgi?id=517224 to be exact).

On point 2 all that&#039;s going on in Gecko is that we start downloading the image once we know that some element will use it as a background.  But for display:none or visibility:hidden elements we never even compute the computed background style (since it&#039;s not needed), so never find out that some element wants the background image.  It&#039;s not a purposeful decision to not download those images, just an artifact of when background computation is optimized away altogether.</description>
		<content:encoded><![CDATA[<p>For what it&#8217;s worth, on item #3 Gecko had the current Webkit behavior for a bit, and we considered it a bug that we did so (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=517224" rel="nofollow">https://bugzilla.mozilla.org/show_bug.cgi?id=517224</a> to be exact).</p>
<p>On point 2 all that&#8217;s going on in Gecko is that we start downloading the image once we know that some element will use it as a background.  But for display:none or visibility:hidden elements we never even compute the computed background style (since it&#8217;s not needed), so never find out that some element wants the background image.  It&#8217;s not a purposeful decision to not download those images, just an artifact of when background computation is optimized away altogether.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Ricaud</title>
		<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/comment-page-1/#comment-1600</link>
		<dc:creator>Anthony Ricaud</dc:creator>
		<pubDate>Sun, 14 Feb 2010 16:13:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevesouders.com/blog/?p=911#comment-1600</guid>
		<description>I&#039;ve already filed a bug about the third behavior : https://bugs.webkit.org/show_bug.cgi?id=31630</description>
		<content:encoded><![CDATA[<p>I&#8217;ve already filed a bug about the third behavior : <a href="https://bugs.webkit.org/show_bug.cgi?id=31630" rel="nofollow">https://bugs.webkit.org/show_bug.cgi?id=31630</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/comment-page-1/#comment-1599</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Sun, 14 Feb 2010 16:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevesouders.com/blog/?p=911#comment-1599</guid>
		<description>I routinely overwrite background images, but it&#039;s only for IE6 and only to get around IE6&#039;s inability to render transparent PNGs.</description>
		<content:encoded><![CDATA[<p>I routinely overwrite background images, but it&#8217;s only for IE6 and only to get around IE6&#8217;s inability to render transparent PNGs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Livingston Samuel</title>
		<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/comment-page-1/#comment-1593</link>
		<dc:creator>Livingston Samuel</dc:creator>
		<pubDate>Sat, 13 Feb 2010 07:25:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevesouders.com/blog/?p=911#comment-1593</guid>
		<description>Nice job Steve. This is one of the aspects that I wanted to analyse, thanks a lot for sharing.</description>
		<content:encoded><![CDATA[<p>Nice job Steve. This is one of the aspects that I wanted to analyse, thanks a lot for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SM</title>
		<link>http://www.stevesouders.com/blog/2010/02/12/5e-speculative-background-images/comment-page-1/#comment-1592</link>
		<dc:creator>SM</dc:creator>
		<pubDate>Sat, 13 Feb 2010 07:10:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevesouders.com/blog/?p=911#comment-1592</guid>
		<description>Definitely a favorite! Intresting post. Thanks</description>
		<content:encoded><![CDATA[<p>Definitely a favorite! Intresting post. Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
