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

On Wednesday 2011-12-28 13:01 +0200, Lea Verou wrote:
> It was to my surprise that not only I couldn't find any current
> pseudo-class for this, but also I couldn't even find a relevant
> discussion on the list.
> 
> Being able to select broken images has many popular use cases:
> - Showing a more user-friendly and/or relevant message to the user,
> something more fitting to the rest of the site perhaps
> - Forcing UAs to display the alt text even when they don't by
> default, as simply as img[alt]:error { content: attr(alt); }
> - Controlling the dimensions of the broken image placeholder
> - Hiding broken images
> - Using the selectors API to select all broken images and display a
> message somewhere

Mozilla actually already has pseudo-classes to match different types
of images that cannot be displayed:
  https://developer.mozilla.org/en/CSS/:-moz-broken
  https://developer.mozilla.org/en/CSS/:-moz-loading
  https://developer.mozilla.org/en/CSS/:-moz-user-disabled
  https://developer.mozilla.org/en/CSS/:-moz-suppressed
These are needed to describe our internal behavior in our UA style
sheet.

> Mozilla even goes as far as to have a custom property for
> rudimentary control over the display of broken images:
> https://developer.mozilla.org/en/CSS/-moz-force-broken-image-icon

-moz-force-broken-image-icon is an ancient hack used to implement a
quirks mode behavior.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂

Received on Wednesday, 28 December 2011 15:04:28 UTC