Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Rule: Valid use of image file name in accessible name #216

Closed
Brynanders opened this issue Aug 15, 2018 · 3 comments
Closed

New Rule: Valid use of image file name in accessible name #216

Brynanders opened this issue Aug 15, 2018 · 3 comments
Assignees
Labels
Rule Use this label for a new rule that does not exist already

Comments

@Brynanders
Copy link
Collaborator

Brynanders commented Aug 15, 2018


name: accessible name is image file name
description: |
This rule checks that the accessible name of an image is not its file name.

success_criterion:

  • 1.1.1 # Non-text Content

test_aspects

  • DOM Tree
  • CSS Styling

authors:

  • Bryn Anderson

Applicability

The rule applies to any HTML img element that is exposed to assistive technologies, where the element has a non-empty alt attribute that is equal to the accessible name of the element, and where the alt attribute of the element references the file name and extension of the src attribute of the element.

Expectation

Each test target has an alt attribute that serves as an appropriate text alternative as described in F30: Failure of Success Criterion 1.1.1 and 1.2.1 due to using text alternatives that are not alternatives (e.g., filenames or placeholder text).

Assumptions

There are currently no assumptions

Accessibility support

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

Background

Test Cases

Pass example 1

Image depicting a PDF file format, uses the .pdf extension in the accessible name.

<img scr="/example.pdf" alt="an example of a .pdf file">

Failure example 1

The accessible name is the image file name and does not serve as an appropriate text alternative.

<img src="/image.jpg" alt="image.jpg file">

Inapplicable example 1

No reference to a file extension or file path in the accessible name.

<img src="/example.pdf" alt="an example of a PDF file">
@Brynanders Brynanders self-assigned this Aug 16, 2018
@Brynanders Brynanders changed the title New Rule: Image alt text is not a file name New Rule: Image file name is not accessible name Aug 16, 2018
@Brynanders Brynanders changed the title New Rule: Image file name is not accessible name New Rule: Image accessible name is not image file name Aug 16, 2018
@Brynanders Brynanders changed the title New Rule: Image accessible name is not image file name New Rule: Valid use of image file name in accessible name Aug 24, 2018
@Brynanders
Copy link
Collaborator Author

Wondering if this rule should be confined to accessible names for images that reference their own image files... or if it should look for any file reference like I have done so far?

@annethyme annethyme added the Rule Use this label for a new rule that does not exist already label Sep 10, 2018
@kasperisager
Copy link
Contributor

I'm wondering if this note can be left out:

Leading and trailing whitespace and difference in case sensitivity should be ignored.

Given that some file systems are case sensitive and that file system paths for sure are whitespace sensitive, it seems to be best to compare the src and alt attributes verbatim.

@Brynanders
Copy link
Collaborator Author

Created PR #263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rule Use this label for a new rule that does not exist already
Projects
None yet
Development

No branches or pull requests

3 participants