Image button has accessible name

  • Rule Typeatomic
  • Rule ID: 59796f
  • Last modified: Aug 21, 2019
  • Accessibility Requirements Mapping
    • 1.1.1 Non-text Content (Level: A)
      • Learn More about 1.1.1 (Non-text Content)
      • Required for conformance to WCAG 2.0 and above on level A and above
      • Outcome mapping:
        • Any failed outcomes: not satisfied
        • All passed outcomes: further testing is needed
        • An inapplicable outcome: further testing is needed
    • 4.1.2 Name, Role, Value (Level: A)
      • Learn More about 4.1.2 (Name, Role, Value)
      • Required for conformance to WCAG 2.0 and above on level A and above
      • Outcome mapping:
        • Any failed outcomes: not satisfied
        • All passed outcomes: further testing is needed
        • An inapplicable outcome: further testing is needed
  • Input Aspects

Description

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

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 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 not only whitespace.

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

<input type="image" name="submit" src="button.gif" alt="Submit" />

Passed Example 2

Image button element with accessible name through aria-label

<input type="image" name="submit" src="button.gif" aria-label="Submit" />

Passed Example 3

Image button element with accessible name through title attribute

<input type="image" name="submit" src="button.gif" title="Submit" />

Passed Example 4

Image button element with accessible name through aria-labelledby

<input type="image" name="submit" src="button.gif" aria-labelledby="id1" />
<div id="id1">Submit</div>

Passed Example 5

Accessible name is not only whitespace.

<input type="image" name="submit" src="button.gif" alt=":-)" />

Passed Example 6

Image button element with accessible name through alt attribute

<input type="image" name="submit" src="button.gif" alt="123" />

Failed

Failed Example 1

Image button element with no attributes to give accessible name

<input type="image" name="submit" src="button.gif" />

Failed Example 2

Image button element with empty alt attribute

<input type="image" name="submit" src="button.gif" alt="" />

Failed Example 3

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

<input type="image" name="submit" src="button.gif" aria-labelledby="id1" />

Failed Example 4

Accessible name is only whitespace.

<input type="image" name="submit" src="button.gif" alt=" " />

Inapplicable

Inapplicable Example 1

HTML button element is not an image button

<button>My button</button>

Inapplicable Example 2

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

<input type="button">My button</input>

Inapplicable Example 3

Button with image inside is not an image button

<button><img src="button.gif" /></button>

Inapplicable Example 4

Image is not a button image

<img alt="W3C logo" />

Inapplicable Example 5

Image button is not included in the accessibility tree

<input type="image" name="submit" src="button.gif" alt="Submit" aria-hidden="true" />

Glossary

Accessible Name

key: accessible-name

The programmatically 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 (work in progress) and SVG Accessibility API Mappings, Name and Description (work in progress).

Included in the accessibility tree

key: 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 (work in progress) and the SVG accessibility API mappings (work in progress).

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.

Outcome

key: outcome

A conclusion that comes from evaluating an ACT Rule on a test subject or one of its constituent test target. An outcome can be one of the three following types:

  • Inapplicable: No part of the test subject matches the applicability
  • Passed: A test target meets all expectations
  • Failed: A test target does not meet all expectations

Note: A rule has one passed or failed outcome for every test target. When there are no test targets the rule has one inapplicable outcome. This means that each test subject will have one or more outcomes.

Note: Implementers using the EARL10-Schema can express the outcome with the outcome property. In addition to passed, failed and inapplicable, EARL 1.0 also defined an incomplete outcome. While this cannot be the outcome of an ACT Rule when applied in its entirety, it often happens that rules are only partially evaluated. For example, when applicability was automated, but the expectations have to be evaluated manually. Such "interim" results can be expressed with the incomplete outcome.

Whitespace

key: whitespace

Characters that have the Unicode "White_Space" property in the Unicode properties list.

This includes:

  • all characters in the Unicode Separator categories, and
  • the following characters in the Other, Control category:

    • Character tabulation (U+0009)
    • Line Feed (LF) (U+000A)
    • Line Tabulation (U+000B)
    • Form Feed (FF) (U+000C)
    • Carriage Return (CR) (U+000D)
    • Next Line (NEL) (U+0085)

Changelog

Aug 21, 2019test: add tests to verify h4 headings (#810)
Aug 21, 2019Editorial changes (#725)
Jul 19, 2019chore: run prettier (#688)
Jul 17, 2019chore: Various typos (#667)
May 15, 2019Glossary and Rule update: Replacing "non-empty" definition (#430)
May 9, 2019Chore: Adapt site to ACT Rules CR format (#547)
May 7, 2019Template update - Image button has accessible name (#514)
May 2, 2019chore: add manual reporting download links to rule (#492)
Apr 29, 2019chore: rename files and update associations (#489)
Apr 16, 2019chore: add unique id to all rules (#478)
Apr 15, 2019chore: WCAG ACT RULES CG Website Update (#437)
Jan 7, 2019Image button has accessible name (#370)

Useful Links


Implementations

Tool NameCreated ByReport
AlfaSiteimproveView Report
Axe-coreDeque SystemsView Report

Acknowledgements