Filename is valid accessible name

  • Rule Typeatomic
  • Rule ID: 9eb3f6
  • Last modified: Jul 19, 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
  • Input Aspects

Description

This rule checks that image elements that use their source filename as their accessible name do so without loss of information to the user.

Applicability

The rule applies to any HTML input element with a type of image, or any HTML element with the semantic role of img, that is included in the accessibility tree, and has an accessible name that is equivalent to the filename specified in the src attribute. Difference in letter casing, and forward and trailing whitespace should be ignored.

Expectation

Each test target has an accessible name that serves an equivalent purpose to the non-text content.

Assumptions

There are currently no assumptions

Accessibility Support

There are no major accessibility support issues known for this rule.

Background

Test Cases

Passed

Passed Example 1

The img element's accessible name uses the filename which accurately describes the image.

<img src="https://www.w3.org/WAI/demos/bad/img/w3c" alt="w3c" />

Passed Example 2

The img element's accessible name includes the filename, which in combination with the text content of the a element accurately describes the image.

<a href="https://www.w3.org/WAI/demos/bad/img/w3c.png" download
	>Download <img src="https://www.w3.org/WAI/demos/bad/img/w3c.png" alt="w3c.png"
/></a>

Failed

Failed Example 1

The img element's accessible name matches the image filename. However the presence of the file extension in the accessible name is redundant and results in the accessible name not accurately describing the image.

<img src="https://www.w3.org/WAI/demos/bad/img/w3c.png" alt="w3c.png" />

Failed Example 2

The input element with a type of image has an accessible name that matches the filename. However the presence of the file extension in the accessible name is redundant and results in the accessible name not accurately describing the image.

<input type="image" src="https://www.w3.org/WAI/demos/bad/before/img/top_weather.gif" alt="top_weather.gif" />

Inapplicable

Inapplicable Example 1

The img element doesn't have the semantic role of image.

<img role="presentation" />

Inapplicable Example 2

The img element is not included in the accessibility tree.

<img style="display:none;" />

Inapplicable Example 3

The img element's accessible name is not equivalent to the file name specified in the src attribute.

<img src="https://www.w3.org/WAI/demos/bad/after/img/teaser_right2.jpg" alt="modanna lily" />

Inapplicable Example 4

The img element's alt attribute matches the filename but is overridden by the aria-label value which takes precedence in the accessible name calculation.

<img
	src="https://www.w3.org/WAI/demos/bad/after/img/teaser_right2.jpg"
	alt="teaser_right2.jpg"
	aria-label="modanna lily"
/>

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).

Filename

key: filename

A filename is a text string that identifies an electronically stored file. In a URL it is located at the end of the path, after the last slash and before any query strings. For example the src attribute specifies a URL path of src="/foo/bar.jpg?baz " which contains the filename bar.jpg.

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.

Semantic Role

key: semantic-role

A semantic role is a semantic association that indicates an object's type. This allows tools to present and support interaction with the object in a manner that is consistent with user expectations about other objects of that type.

The semantic role of an element is its explicit semantic role if it has any, otherwise, the implicit semantic role is used.


Changelog

Jul 19, 2019chore: run prettier (#688)
Jun 25, 2019Update filename-is-accessible-name-9eb3f6.md (#620)
May 9, 2019Chore: Adapt site to ACT Rules CR format (#547)
May 7, 2019Template update - Filename is valid accessible name (#507)
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)
Mar 26, 2019SC1-1-1-filename-is-valid-accessible-name (#263)

Useful Links


Implementations

Tool NameCreated ByReport
AlfaSiteimproveView Report

Acknowledgements