Re: [css4-images] Add format() hints to image()

On Thu, Feb 14, 2013 at 2:40 AM, Jake Archibald <jaffathecake@gmail.com> wrote:
> The problem: image('whatever.webp', 'whatever.png')
>
> If the browser doesn't support webp it will still download 'whatever.webp'
> and attempt a decode before it'll fallback to the png. It could exit early
> when it gets the content-type header, but that's still more network activity
> than ideal.
>
> Solution: Introduce format(), from @font-face
>
> https://gist.github.com/jakearchibald/2f6baeeefd0eee59d9ec
>
> The browser wouldn't bother with the webp if it doesn't understand it. Like
> fonts, format isn't limited to mime types, allowing for
> format('webp-progressive'), if webp ever gets a progressive format.
>
> The formats would be defined by the spec, as with fonts.
[snip additional suggestions, as I don't like them]

Good idea - this fixes the problem I had before with media types not
being enough information to really distinguish.

Do you have any idea what set of format strings we should initially support?

~TJ

Received on Thursday, 14 February 2013 17:34:05 UTC