dequelabs / dequelabs/axe-core

Critical error of alt attribute not present is thrown even if image is wrapped inside `<figure>` element and a caption is provided in `<figcaption>` element.

Open
#4,473 1 comment 0 reactions 0 assignees View on GitHub
accessibility support rule metadata rules
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

### Product

axe Extension

### Product Version

4.80.1

### Latest Version

- [X] I have tested the issue with the latest version of the product

### Issue Description

#### Expectation
The extension should not throw warning because `` element was present to provide caption for the image.

#### Actual
The extension threw a `critical` level issue titled *"Images must have alternate text"*.

#### How to Reproduce
The site tested was MDN's demo of [Basic View Transitions](https://mdn.github.io/dom-examples/view-transitions/).

Screenshot:
![alt attribute error](https://github.com/dequelabs/axe-core/assets/157268750/4a07bdba-6aa9-4907-ba91-bf80e1af3762)

#### Additional context
[W3's Guidance for conformance checkers](https://www.w3.org/TR/2014/REC-html5-20141028/embedded-content-0.html#guidance-for-conformance-checkers) says:
- The [img](https://www.w3.org/TR/2014/REC-html5-20141028/embedded-content-0.html#the-img-element) element is in a [figure](https://www.w3.org/TR/2014/REC-html5-20141028/grouping-content.html#the-figure-element) element that satisfies [the conditions described above](https://www.w3.org/TR/2014/REC-html5-20141028/embedded-content-0.html#figcaption-as-alt-condition).
- The condition, in short is: *"In other words, the only content of the [figure](https://www.w3.org/TR/2014/REC-html5-20141028/grouping-content.html#the-figure-element) is an [img](https://www.w3.org/TR/2014/REC-html5-20141028/embedded-content-0.html#the-img-element) element and a [figcaption](https://www.w3.org/TR/2014/REC-html5-20141028/grouping-content.html#the-figcaption-element) element, and the [figcaption](https://www.w3.org/TR/2014/REC-html5-20141028/grouping-content.html#the-figcaption-element) element must include (caption) content."* - [W3](https://www.w3.org/TR/2014/REC-html5-20141028/embedded-content-0.html#figcaption-as-alt-condition)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.