Last updated:

Created by:

Success Criterion:

Description

This rule checks that each image button element has an accessible name

Accessibility Requirements

This conformance rule relates to:

Test procedure

Applicability

The rule applies to any HTML input element with a type attribute in the Image Button state, that is included in the accessibility tree.

Note: The specification of the [type](https://www.w3.org/TR/html/sec-forms.html#element-attrdef-input-type) attribute describes in detail how to map the value of the attribute to its corresponding state.

Expectation

Each target element has an accessible name that is non-empty.

Assumptions

Accessibility Support

There is a known combination of a popular browser and assistive technology that does not by default support title as an accessible name.

Background

Test Cases

Passed

Passed example 1

Image button element with accessible name through alt attribute

Code Snippet:
 <input type="image" name="submit" src="button.gif" alt="Submit" />
 
Example Output: Open in a new tab/ window

Passed example 2

Image button element with accessible name through aria-label

Code Snippet:
 <input type="image" name="submit" src="button.gif" aria-label="Submit" />
 
Example Output: Open in a new tab/ window

Passed example 3

Image button element with accessible name through title attribute

Code Snippet:
 <input type="image" name="submit" src="button.gif" title="Submit" />
 
Example Output: Open in a new tab/ window

Passed example 4

Image button element with accessible name through aria-labelledby

Code Snippet:
 <input type="image" name="submit" src="button.gif" aria-labelledby="id1" />
<div id="id1">Submit</div>
 
Example Output: Open in a new tab/ window

Failed

Failed example 1

Image button element with no attributes to give accessible name

Code Snippet:
 <input type="image" name="submit" src="button.gif" />
 
Example Output: Open in a new tab/ window

Failed example 2

Image button element with empty alt attribute

Code Snippet:
 <input type="image" name="submit" src="button.gif" alt="" />
 
Example Output: Open in a new tab/ window

Failed example 3

Image button with aria-labelledby that does not reference an id that exists in the same document

Code Snippet:
 <input type="image" name="submit" src="button.gif" aria-labelledby="id1" />
 
Example Output: Open in a new tab/ window

Inapplicable

Inapplicable example 1

HTML button element is not an image button

Code Snippet:
 <button>My button</button>
 
Example Output: Open in a new tab/ window

Inapplicable example 2

HTML input element with type with a type attribute in the Button state is not an image button

Code Snippet:
 <input type="button">My button</input>
 
Example Output: Open in a new tab/ window

Inapplicable example 3

Button with image inside is not an image button

Code Snippet:
 <button><img src="button.gif" /></button>
 
Example Output: Open in a new tab/ window

Inapplicable example 4

Image is not a button image

Code Snippet:
  <img alt="W3C logo" />
 
Example Output: Open in a new tab/ window

Inapplicable example 4

Image button is not included in the accessibility tree

Code Snippet:
 <input type="image" name="submit" src="button.gif" alt="Submit" aria-hidden="true" />
 
Example Output: Open in a new tab/ window

Glossary

Included in the accessibility tree

Elements included in the accessibility tree of platform specific accessibility APIs. Elements in the accessibility tree are exposed to assistive technologies, allowing users to interact with the elements in a way that meet the requirements of the individual user.

The general rules for when elements are included in the accessibility tree are defined in the core accessibility API mappings. For native markup languages, such as HTML and SVG, additional rules for when elements are [included in the accessibility tree][] can be found in the HTML accessibility API mappings and the SVG accessibility API mappings.

Note: Users of assistive technologies might still be able to interact with elements that are not included in the accessibility tree. An example of this is a focusable element with an aria-hidden attribute with a value of true. Such an element could still be interacted with using sequential keyboard navigation regardless of the assistive technologies used, even though the element would not be included in the accessibility tree.

Accessible Name

The programatically determined name of a user interface element that is included in the accessibility tree.

The accessible name is calculated using the accessible name and description computation.

For native markup languages, such as HTML and SVG, additional information on how to calculate the accessible name can be found in HTML Accessibility API Mappings 1.0, Accessible Name and Description Computation and SVG Accessibility API Mappings, Name and Description.

Non-empty text string

A string of characters (text) is considered “non-empty” if it contains 1 or more characters that are contained within any of the following unicode categories:

  • Ll: Letter, Lowercase
  • Lu: Letter, Uppercase
  • Lt: Letter, Titlecase
  • Lo: Letter, Other
  • Lm: Letter, Modifier
  • Nd: Number, Decimal Digit

For more details on unicode categories, check out www.fileformat.info/info/unicode/category/

Test Aspects

Test aspects are defined as part of the ACT Rules format 1.0.
  • DOM Tree

  • CSS Styling

Contribute






GitHub

Contributing is open to anyone. We welcome any new issues or pull requests for changes. Auto WCAG Rules has conference calls every 4 weeks. If you are interested in becoming an active contributor or reviewer, we ask that you join the Auto WCAG Rules community group through the W3C Website. This requires setting up a W3C account, may require approval by the organization you work for if they are a W3C member.

Learn more about contributing to Auto WCAG Rules Join the Auto WCAG Rules community group now!