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

Re: [css4-ui]/[css4-selectors] Pseudo-class for selecting broken images & other external resources

From: Matthew Wilcox <elvendil@gmail.com>
Date: Fri, 6 Jan 2012 08:05:58 +0000
Cc: www-style@w3.org
Message-Id: <A0C53A44-90AC-4DA9-B8C4-5ACEACF7BF5C@gmail.com>
To: Edward O'Connor <eoconnor@apple.com>
"img { content: image(attr(src as url), "fallback.png"); }"

Surely that rule will be applied regardless of whether the image has loaded or not? CSS inspects the src attribute, not whether it's loaded?

Additionally there is a major point being missed here: it's not just about resource loading from the mark-up, we need control when the CSS image has not loaded too!

The use case is this: better accessibility in scenario's where an author is using "image replacement" techniques but the client has images disabled, or simply didn't load.

Right now we have to use tricks such as text-indent:-999em; to hide text, or use a span to cover the text and set a background on the span.

It'd be nicer (and stop pollution of the mark-up) if CSS were able to tell if a resource had loaded and apply a fallback rule if it hadn't.

I'd tried CSS generated content to do the same job as the span, but could not get it to work.
Received on Friday, 6 January 2012 09:05:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:09 UTC