Re: [css4-images] Type hinting in image()

* Jake Archibald wrote:
>background: image('whatever.webp', 'whatever.png');
>
>Currently the browser would download whatever.webp even if it doesn't
>support it. Could image-tags be extended to allow type hinting? Eg...
>
>background: image(image/webp 'whatever.webp', 'whatever.png');
>
>...where the browser wouldn't make a request for whatever.webp if it
>didn't accept the image/webp type, similar to how @font-face uses
>format().

A bare media type would probably be insufficient if you consider the
history of the two formats in your example (some implementations did
support PNG but not alpha channels, and in case of "WebP", loss-less
compression and transparency are relatively new features). It might
be wise to plan ahead and allow for a more flexible syntax if such a
feature was introduced.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Thursday, 3 January 2013 17:18:53 UTC