Re: [css3-images] Indicating it's optional to retrieve a url specified in background-image (or font-face)

On Wed, Jul 4, 2012 at 1:00 PM, Andy Davies <dajdavies@gmail.com> wrote:
> Jason Grigsby and Guy Podjarny have each done research into the page
> weight of responsive designs and have found that at smaller
> resolutions page weight doesn't currently decrease for many sites.
>
> The page weight is generally going to be an issue for phones, tablets
> etc due to their limited memory, processor speed etc. but it's at the
> network level where I think it really becomes an issue especially when
> connected via a lower throughput cellular network.
>
> I've been researching various means of detecting whether someone is
> connected via a cellular network and during this process came to the
> conclusion that perhaps what we need is a way of indicating external
> resources can be optional i.e. at lower throughputs the UA can choose
> not to download them, but can use them if they are already cached.
>
> Background images and font-face are the obvious candidates for an
> optional property e.g.
>
>    background-image: image('wavy.png') optional;
>
> Not quite sure whether this works though:
>
>     background-image: image('wavy.svg', 'wavy.png' , 'wavy.gif') optional;
>
> Also not sure whether a single optional property is the right way to
> go, or at what throughput level it actually would kick in but I'd be
> really interested in others thoughts.

In Images 4 I will define the image-set() function, which lets the
browser do bandwidth discrimination in a manner basically identical to
<img srcset>.  This was proposed by Apple a few months ago and
currently has an experimental implementation in WebKit (I don't think
it's web-exposed yet).

It seems that this could be addressed by creating a solid-color image
(with "image(black)" or the like) and giving it a small descriptor,
like .1x or even 0x.

Alternately, we could allow <color> and give it this behavior, where
it's used as a fallback if the browser decides it doesn't want to
download any of the images.

~TJ

Received on Monday, 9 July 2012 21:55:49 UTC