Open
Description
The Resource State Pseudo-classes section mentions (emphasis mine):
The pseudo-classes in this section apply to elements that represent loaded resources, particularly images/videos
Yet none of the currently defined pseudo classes seems to actually apply to any images.
Following up on a recent popular tweet that used onerror
on img
-tags to style failed images, I would like to mimic #3821 and resurrect a few of the pseudo-classes suggested in #3134
Primarily I would like to see:
:failed
– a replacement for the use ofonerror
to style images that fail to load:loading
– a way to style images that are in the process of loading (would include both downloading and decoding I think)
Could also be useful to support the existing:
:stalled
– as images on bad internet connections can very much stall to load as well, especially a progressive JPEG which could me stuck in a low quality state.