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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 4 Jan 2013 09:36:40 -0800
Message-ID: <CAAWBYDA2m8VNKEdgVAaqW=PN-LDwzM6jkPRpcvbKa=X=DsyYfA@mail.gmail.com>
To: Jake Archibald <jaffathecake@gmail.com>
Cc: www-style list <www-style@w3.org>
On Jan 2, 2013 3:13 AM, "Jake Archibald" <jaffathecake@gmail.com> 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().
>
> 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.

What Bjoern said. We have a recent existence proof of the same media type
having rather disparate features, so it seems necessary to have some way of
distinguishing this in a more fine-grained manner if we want such a
declarative mechanism.

(As a side note, I'd use a format() function, like what @font-face uses.)

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

People didn't seem to like the complexity it brought into the syntax to
distinguish between linear and parallel alternatives.

~TJ
Received on Friday, 4 January 2013 17:37:06 GMT

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