Hi David, A browser will fetch a style sheet but only fetches an image background it contains upon use in the XHTML. Consequently overwriting background-image: url('http://example.com'); With background-image: url('data:...'); will not fetch the image but use the data version. So to the question "Do browsers which support the data scheme successfully override the regular image before starting to download it?" the answer is yes.
Unfortunately the answer to the second question "Do browsers which don't support it still use the earlier declaration? Or do they go "I accept url() values, will override now"?" is no, they will display garbage if the data URI is presented. But please note all modern browsers support the data URI scheme. IEv8 was the last to employ this standard. There is a link at the page bottom which suggests a method of auto detecting whether data URIs are supported. I've not fully investigated the possibilities as I'm happy that support, except IEv7 and below, is ubiquitous. My whole site utilises CSS sprites and data URI's served via gzip. The performance increase is phenomenal. Regards Mike Foskett -----Original Message----- From: li...@webstandardsgroup.org [mailto:li...@webstandardsgroup.org] On Behalf Of David Dorward Sent: 10 February 2010 11:59 To: wsg@webstandardsgroup.org Subject: Re: [WSG] Data URI encoder On 10 Feb 2010, at 11:48, Hugo Mendes wrote: >> http://websemantics.co.uk/online_tools/image_to_data_uri_convertor/ > Unfortantly this technique doesn't work on IE6 and 7. ... as it says on the page? Which suggests work arounds? On the subject of the suggested workaround (conditional comments) - what about other browsers which don't support data URIs? How do browsers behave, in practice, given: background-image: url('http://example.com'); background-image: url('data:...'); Do browsers which support the data scheme successfully override the regular image before starting to download it? Do browsers which don't support it still use the earlier declaration? Or do they go "I accept url() values, will override now"? -- David Dorward http://dorward.me.uk ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: memberh...@webstandardsgroup.org ******************************************************************* This is a confidential email. Tesco may monitor and record all emails. The views expressed in this email are those of the sender and not Tesco. Tesco Stores Limited Company Number: 519500 Registered in England Registered Office: Tesco House, Delamare Road, Cheshunt, Hertfordshire EN8 9SL VAT Registration Number: GB 220 4302 31 ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: memberh...@webstandardsgroup.org *******************************************************************