Skip to content

Error thrown when <img> with alt="" includes role="presentation" #1425

@clapierre

Description

@clapierre

I understand that when an image has alt="" this has an implicit role of "presentation" but we have a use-case in the publishing industry where publishers are using tools like InDesign from Adobe where it puts alt="" for every image in their book and it makes remediating and conformance checking these books very difficult to determine if these were "meant" to be really presentational images or are in error and in need of remediation with valid alt text describing the image.

When we see that there is both alt="" and role="presentation" we now know that these are meant to be presentational images and are not a mistake by a process earlier down the supply chain.

We also have been promoting that presentational images include both alt="" and role="presentation" in our GCA program for the past 4 years to over 50 publishers and conversion vendors world wide.

From looking at the Specification while it says it is "NOT RECOMMENDED" this to me is a "SHOULD" not a "MUST" statement.

From the Aria in HTML specification it states:

While setting an ARIA role and/or aria-* attribute that matches the implicit ARIA semantics is NOT RECOMMENDED, in some situations explicitly setting these attributes can be helpful – for instance, in user agents that don't expose specific implicit ARIA semantics.

Validator Error:

IE:
https://validator.w3.org/nu/#file
Error: An img element which has an alt attribute whose value is the empty string must not have a role attribute.
From line 11, column 9; to line 11, column 66
↩ ↩

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions