W3C home > Mailing lists > Public > www-style@w3.org > January 2013

[css4-images] Type hinting in image()

From: Jake Archibald <jaffathecake@gmail.com>
Date: Wed, 2 Jan 2013 11:09:42 +0000
Message-ID: <CAJ5xic-Fd5kkDLLpgKwizvTF=eJW=TTo4FyoBAWJL2jTxc=GMA@mail.gmail.com>
To: W3C CSS Mailing List <www-style@w3.org>
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().

Alternatively (as Tab's mentioned) there could be a @image rule
similar to @font-face, with a format/type function, but that may be
more verbose than necessary.

As an aside, what's preventing image-set() behaviours being merged
into image(), or vice versa?

Jake.
Received on Wednesday, 2 January 2013 11:10:09 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT