Multifunction tests

# longdesc-tests

Proposed tests for the HTML Image Description Extension specification. These tests are © chaals, and available under the W3C Software license

## Multifunction tests

These 15 tests include descriptions under different combinations of circumstances - images included "normally", as data: URIs, or missing, with the descriptions internal or external to the page, as a data: URI, or in a location only reachable by taking into account the base element.

The same tests are used to provide 3 results: 1 Can the user discover there is an image that has a long description available? 2 Can the user access the description? To pass, the user should arrive at the "pass page" which has a heading "Pass" followed by a description, or the focus must be on the text "Pass, if the focus is here" which is followed by a description of the image. 3 Is the long description available to system accessibility APIs

### Longdesc value as data:URI

- data:URI image with data:URI description
- Empty image with data:URI description
- External image with data:URI description (with extra spaces)
- External image with data:URI description

### Longdesc value as external URI

- data:URI with External description
- Empty image with an External description
- External image with External description (with extra spaces)
- External image with External description

### Longdesc value as internal URI (same page link)

- data:URI with Internal description
- Empty image with an Internal description
- External image with an Internal description (with extra spaces)
- External image with an Internal description

### Longdesc value as a fragment in an external resource

- data:URI with External description fragment
- Empty image with an External description fragment
- External image with External description fragment (with extra spaces around the URL)
- External image with External description fragment

### Longdesc value as external URI in presence of `<base>` element

- External image with External Description (relative base element set)
- External image with External Description (absolute base element set)

### Longdesc for an image within an iframe

- Image in an `<iframe>` with External Description

## Automated tests

Longdesc value updated by javascript tests that the HTML attribute reflects changes made by javascript. To pass, the browser must redirect to the "Longdesc test Pass Page" which has the word "Pass" as a heading, followed by a description of the image. Displaying the "Longdesc test Fail Page" would indicate a failure of this test.

## Validation / Repair tool tests

Invalid long description (plain text) contains an invalid long description (plain text) and can be used to test User Agent and validation tool handling. NOTE: Handling of invalid longdescs by user agents is currently undefined. Invalid long description (empty attribute) contains an invalid long description (plain text) and can be used to test User Agent and validation tool handling. NOTE: Handling of invalid longdescs by user agents is currently undefined. Pointer to an invalid long description (not contained in a well-formed fragment) points to a long description in a page fragment whose target is an empty element. Validation tools should at least generate a warning, since an empty element is almost certainly not an adequate description, and is likely instead to reflect not passing the relevant authoring requirement.

## Test results

Preliminary test results are available for some platforms. More results are welcome.

## Supporting files

The following files are required to make one or more of the tests work:

- README.html - this documentation
- fail.html
- pass.html
- fail-fragment.html
- pass-fragment.html
- picture.png
- rebased/picture2.png)
- rebased/fail.html (actually a pass page, used to test what happens in the presence of a `<base>` element)