4.8.1 The img element

ISSUE-30 (longdesc) ISSUE-31 (missing-alt) blocks progress to Last Call

Flow content.
Phrasing content.
Embedded content.
If the element has a usemap attribute: Interactive content.
Contexts in which this element can be used:
Where embedded content is expected.
Content model:
Content attributes:
Global attributes
DOM interface:
 NamedConstructor=Image(in unsigned long width),
 NamedConstructor=Image(in unsigned long width, in unsigned long height)]
interface HTMLImageElement : HTMLElement {
           attribute DOMString alt;
           attribute DOMString src;
           <ZZZ>attribute DOMString longdesc;</ZZZ>
                        attribute DOMString useMap;
           attribute boolean isMap;
           attribute unsigned long width;
           attribute unsigned long height;
  readonly attribute unsigned long naturalWidth;
  readonly attribute unsigned long naturalHeight;
  readonly attribute boolean complete;

An img element represents an image.

The image given by the src attribute is the embedded content; the value of the alt attribute provides equivalent content for those who cannot process images or who have image loading disabled.

The src attribute must be present, and must contain a valid non-empty URL potentially surrounded by spaces referencing a non-interactive, optionally animated, image resource that is neither paged nor scripted.

Images can thus be static bitmaps (e.g. PNGs, GIFs, JPEGs), single-page vector documents (single-page PDFs, XML files with an SVG root element), animated bitmaps (APNGs, animated GIFs), animated vector graphics (XML files with an SVG root element that use declarative SMIL animation), and so forth. However, this also precludes SVG files with script, multipage PDF files, interactive MNG files, HTML documents, plain text documents, and so forth.

The requirements on the alt attribute's value are described in the next section.

<ZZZ>The longdesc attribute may be present. This attribute contains a link to a long description of the image. If present, it must contain a valid non-empty URL potentially surrounded by spaces.

Web authors are encouraged to use this attribute for long text alternatives that are either too long to be included in the main flow of the document or benefit from structured markup that cannot be included in an alt attribute.

To obtain the corresponding long text alternative link, the value of the attribute must be resolved relative to the element. The link must point to either a different document from the image or a fragment of the same document that does not contain the image. User agents should allow users to access long text alternatives in a device independent manner. Rendering examples are provided in the rendering section.

The longdesc IDL attribute must reflect the element's longdesc content attribute.

When the long description is included in a separate Web page, this page can then be reused for all occurrences of the image on the Website. If the separate Web page contains any additional information besides the long description, the longdesc URL needs to contain a fragment address to the particular section on that page that contains the long description. This will provide users direct access to the description.</ZZZ>