See also the ALT text mini FAQ.
Behaviour should IMHO be as described in my spec.
So, without further delay, lets check the behaviour in all these cases...
Prior to download attempt, if download attempt is going to be attempted (i.e., not if images are disabled), then...
If the image size (width&height) is given (eg, from HTML attributes or from applicable CSS properties), then leave a transparent gap of the right size where the image will end up, using CSS2 replaced content rules as appropriate.
Instead of a transparent gap, some browsers may opt to draw a box with a "missing image" glyph and the alternate text. This is just as acceptable.
The image below (which is 0 bytes long) will take 60 seconds to download. The image has been given, using HTML attributes, a width and height of 50 pixels. Therefore below this paragraph there should be a single inset box with a height of just over 50 pixels (and a width of most of the viewport).
The image below (which is also 0 bytes long) will also take 60 seconds to download. The image has been given, using CSS properties, a width and height of 50 pixels. Therefore below this paragraph there should be a single inset box with a height of just over 50 pixels (and a width of most of the viewport).
If the image size is not specified, then draw in the alternate representation as described below.
The easiest way to test this is to do it at the same time as the broken images. Hence the tests for this section are actually shown in section 2.2.
Tests for this are out of scope for this test page.
If the image is not valid, then insert the alternative text into the document as if it were generated content, removing any placeholder gap. The alternative text should be generated using the rules below.
alt
attributeIf alt attribute is present, then use that (even if empty).
There should now follow twenty five identical lines. (Note. Some have numbers in brackets at the end. Please ignore those numbers, they are placeholders for investigating bugs.)
Here is a missing image. (1)
Here is a image. (2)
Here is a missing image.
Here is a image.
Here is a image.
Here is a missing image.
Here is a missing image.
Here is a image. (3)
Here is a missing image.
Here is a image.
Here is a image.
Here is a missing image.
Here is a missing image.
Here is a image. (4)
Here is a missing image.
Here is a image.
Here is a image.
Here is a missing image.
Here is a missing image.
Here is a image. (5)
Here is a missing image.
Here is a image.
Here is a image.
Here is a missing image.
Here is a missing image.
alt
attributeIf there is no 'alt' attribute then for INPUT elements, the value attribute should be used, defaulting to the same string as a normal submit button. For IMG elements, the lack of an 'alt' attribute should cause the alternate text to be blank.
There should now follow seven identical lines.
Here is a missing image.
Here is a missing image.
Here is a missing image.
Here is a missing image.
Here is a missing image. (4)
Here is a missing image.
Here is a missing image.
There should now follow seven identical lines, except that the styling on the first might be different.
Here:
Here:
Here:
Here:
Here:
Here:
Here:
Ensure that clicking on the alt texts does not cause any problems:
(1)
(2)
Ensure that clicking on the following links takes you to the placeholder page:
The text below should be self explanatory.
Any other ideas?
Resize your browser window (if applicable to your browser) and see if anything strange happens... It shouldn't (obviously!).
Bugzilla: Bug 1994, Bug 2534, Bug 2723, Bug 2756, Bug 3008, Bug 3268, Bug 4354, Bug 4584, Bug 4661, Bug 5764, Bug 5830, Bug 6166, Bug 6553, Bug 6559.
Last updated in July 1999.