Skip to content

Commit

Permalink
clarify img naming steps
Browse files Browse the repository at this point in the history
related to w3c/accname#27
  • Loading branch information
scottaohara committed Mar 21, 2021
1 parent 366d2b8 commit 7db8d84
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6408,29 +6408,28 @@ <h4><code>figure</code> Element Accessible Description Computation</h4>
</section>
</section>
<section>
<h3><code>img</code> Element</h3>
<h3>`img` Element</h3>
<section>
<h4><code>img</code> Element Accessible Name Computation</h4>
<h4>`img` Element Accessible Name Computation</h4>
<ol>
<li>
If the <code>img</code> element has an <a href="https://www.w3.org/TR/wai-aria-1.1/#aria-label"><code>aria-label</code></a> or an <a href="https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby"><code>aria-labelledby</code></a> attribute the <a class="termref">accessible name</a> is to be calculated using the algorithm defined in <a href="" class="accname">Accessible Name and Description: Computation and API Mappings 1.1</a>.
If the `img` element has an <a href="https://www.w3.org/TR/wai-aria-1.1/#aria-label">`aria-label`</a> or an <a href="https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby">`aria-labelledby`</a> attribute the <a class="termref">accessible name</a> is to be calculated using the algorithm defined in <a href="" class="accname">Accessible Name and Description: Computation and API Mappings 1.1</a>.
</li>
<li>Otherwise use <code>alt</code> attribute.</li>
<li>Otherwise use <code>title</code> attribute.</li>
<li>Otherwise use `alt` attribute, even if its value is empty.</li>
<li>Otherwise, if there is no `alt` attribute use the `title` attribute.</li>
<li>
If none of the above yield a usable text string there is no <a class="termref">accessible name</a>.
Otherwise there is no <a class="termref">accessible name</a>.
</li>
</ol>
<!--<p class="note">If the <code>img</code> 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 href="https://www.w3.org/TR/wai-aria-1.1/#aria-label"><code>aria-label</code></a>, <a href="https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby"><code>aria-labelledby</code></a>, <code>alt</code> or <code>title</code>. The presence of any of these indicates the author's intention to indicate that the <code>img</code> 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 class="termref">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 class="termref">accessible name</a>.</p>-->
</section>
<section>
<h4><code>img</code> Element Accessible Description Computation</h4>
<h4>`img` Element Accessible Description Computation</h4>
<ol>
<li>
If the element has an <a href="https://www.w3.org/TR/wai-aria-1.1/#aria-describedby"><code>aria-describedby</code></a> attribute the <a class="termref">accessible description</a> is to be calculated using the algorithm defined in <a href="" class="accname">Accessible Name and Description: Computation and API Mappings 1.1</a>.
If the element has an <a href="https://www.w3.org/TR/wai-aria-1.1/#aria-describedby">`aria-describedby`</a> attribute the <a class="termref">accessible description</a> is to be calculated using the algorithm defined in <a href="" class="accname">Accessible Name and Description: Computation and API Mappings 1.1</a>.
</li>
<li>
Otherwise use the <code>title</code> attribute if it wasn't used as the <a class="termref">accessible name</a>.
Otherwise use the `title` attribute if it wasn't used as the <a class="termref">accessible name</a>.
</li>
<li>
If none of the above yield a usable text string there is no <a class="termref">accessible description</a>.
Expand Down

0 comments on commit 7db8d84

Please sign in to comment.