W3C home > Mailing lists > Public > www-style@w3.org > August 2009

Re: [CSS3] content, background-image and fallbacks

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 19 Aug 2009 15:13:27 -0700
Message-ID: <4A8C7907.5020009@terrainformatica.com>
To: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
CC: www-style@w3.org
Giuseppe Bilotta wrote:
> Hello all,
> I've recently found myself considering what kind of fallback
> capabilities current web standards offer, in case where referenced
> content is either unavailable or unsupported by user agents. The
> situation is not particularly nice, although some form of fallback
> support is being built e.g. in HTML5 with the 'source' tag for audio
> and video (although it is not being added to img, which is a pity; but
> anyway, that's for another place to discusse).

I am using[1] :incomplete and :busy state flags exposed to CSS.

:busy - element has active download requests to external resources (e.g. 
all kind of images, document data in <frame>, etc.)
:incomplete - some of data needed for the element (list above) is not 
delivered in full or one of requests has failed.

Therefore these rules:

img:busy {  background-image: url(stock:activity-spin.png);  }
img:not(:busy):incomplete {  background-image: 
url(stock:image-not-available.png); content: attr(alt);  }

define what most of UAs are doing when image is not available.

In general selector :
something:not(:busy):incomplete {...}
can be used to trigger fallback rendering when some images defined by 
element style are not available.

Practice shows that most of cases this is enough.

[1] http://www.terrainformatica.com/htmlayout/main.whtm

Andrew Fedoniouk.

Received on Wednesday, 19 August 2009 22:14:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:38 UTC