Skip to content

Commit

Permalink
clarify img naming steps (#322)
Browse files Browse the repository at this point in the history
* clarify img naming steps

related to w3c/accname#27

* remove reference to note that’s no longer there

add in new note as a reminder that `alt=“”` means the `img` is meant to be exposed as role=presentation
  • Loading branch information
scottaohara authored May 12, 2022
1 parent 0998cbc commit 18d7dcb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions html-aam/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1395,9 +1395,6 @@ <h3>HTML Element Role Mappings</h3>
<div class="role">
<a class="core-mapping" href="#role-map-presentation">`presentation`</a>
</div>
<div class="general">
See also the Note under <a href="#img-element-accessible-name-computation">`img` element Accessible Name Computation</a>.
</div>
</td>
<td class="ia2"><div class="general">Use WAI-ARIA mapping</div></td>
<td class="uia"><div class="general">Use WAI-ARIA mapping</div></td>
Expand Down Expand Up @@ -6146,13 +6143,16 @@ <h4>`img` Element Accessible Name Computation</h4>
<li>
If the `img` element has an <a data-cite="wai-aria-1.2/#aria-label">`aria-label`</a> or an <a data-cite="wai-aria-1.2/#aria-labelledby">`aria-labelledby`</a> attribute the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is to be calculated using the algorithm defined in <a href="" class="accname">Accessible Name and Description: Computation and API Mappings</a>.
</li>
<li>Otherwise use `alt` attribute.</li>
<li>Otherwise use `title` attribute.</li>
<li>
If none of the above yield a usable text string there is no <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.
Otherwise 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>Otherwise there is no <a class="termref">accessible name</a>.</li>
</ol>
<!--<p class="note">If the `img` element is exposed in the <a class="termref">accessibility tree</a> and the computed text alternative is empty, then check for the presence of <code>role="presentation"</code> or any labeling attribute that specifies an empty label, specifically <a data-cite="wai-aria-1.2/#aria-label">`aria-label`</a>, <a data-cite="wai-aria-1.2/#aria-labelledby">`aria-labelledby`</a>, `alt` or `title`. The presence of any of these indicates the author's intention to indicate that the `img` is decorative or redundant. In this case, the user agent MUST set the name to an empty string. If none of these attributes are present, this indicates the author simply did not provide an accessible label for the image, and the implementation MUST return an <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> of NULL instead of an empty string if the <a class="termref">accessibility API</a> supports it. This hints to the <a class="termref" data-lt="Assistive Technologies">assistive technology</a> to do its own heuristic processing to repair the missing <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>.</p>-->
</section>
<section>
<h4>`img` Element Accessible Description Computation</h4>
Expand Down

0 comments on commit 18d7dcb

Please sign in to comment.