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

The responsive images extensions refer to content images (i.e. images that
are part of the HTML content), rather than CSS background images, to which
this proposal refers to.
I agree that some of the problems are similar, but the solutions are not
necessarily so.

Yoav


On Thu, Feb 14, 2013 at 3:30 PM, Glenn Adams <glenn@skynav.com> wrote:

> You may wish to take a look at
> https://dvcs.w3.org/hg/html-proposals/raw-file/9443de7ff65f/responsive-images/responsive-images.htmlwhich attempts to address some of these problems.
>
>
> On Thu, Feb 14, 2013 at 3: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.
>>
>> Alternative solution: format fragment
>>
>>
>> https://gist.github.com/jakearchibald/2f6baeeefd0eee59d9ec#file-gistfile1-css-L12
>>
>> We already use the fragment for media fragments, could use it for format
>> too. However, this creates repetition in image-set. Meh.
>>
>> Another alternative: Look at the 'extension'
>>
>> Could look at the suffix of the url. This has repetition in image-set as
>> above, but also feels clunky, especially for format sub-types, eg
>> whatever.webp-progressive.
>>
>
>

Received on Thursday, 14 February 2013 14:42:05 UTC