Skip to content

Commit

Permalink
Update accessible name calculation algorithm for img to use figcaption
Browse files Browse the repository at this point in the history
if an img has no other naming mechanism, and it is a descendent of a figure element with a figcaption, but the figure has no other descendants, then the figcaption can be used as the image's accname.
  • Loading branch information
scottaohara authored Jan 10, 2025
1 parent cf18f5a commit 79881fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions html-aam/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16256,13 +16256,14 @@ <h4>`img` Element Accessible Name Computation</h4>
<a href="" class="accname">Accessible Name and Description: Computation and API Mappings</a>.
</li>
<li>
Otherwise use `alt` attribute, even if its value is the empty string.
If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty: use `alt` attribute, even if its value is the empty string.
<div class="note">
An `img` with an `alt` attribute whose value is the empty string is mapped to the
<a class="core-mapping" href="#role-map-presentation">`presentation`</a> role. It has no accessible name.
</div>
</li>
<li>Otherwise, if there is no `alt` attribute use the `title` attribute.</li>
<li>If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty and there is no `alt` attribute, use the `title` attribute.</li>
<li>If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty and there are no `alt` or `title` attributes, and the `img` is a descendent of a `figure` element with a child `figcaption` but no other <a data-cite="html/dom.html#flow-content-2">flow content</a> or <a data-cite="html/dom.html#inter-element-whitespace">whitespace</a> descendents, then use the <a data-cite="accname-1.2/#mapping_additional_nd_te">text equivalent computation</a> of the `figcaption` element's subtree.
<li>Otherwise there is no <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.</li>
</ol>
</section>
Expand Down

0 comments on commit 79881fa

Please sign in to comment.