Skip to content

Commit 5cae232

Browse files
authored
Clarify and consolidate img ARIA allowances (#453)
Clarify and consolidate img ARIA allowances This PR closes #424 and #452 * clarify when img role is allowed * add meter to allowed role for img * similar to progressbar, meter should thus also be allowed. * fix img lacking alt allowance * update changelog
1 parent 70e3d30 commit 5cae232

File tree

1 file changed

+37
-23
lines changed

1 file changed

+37
-23
lines changed

index.html

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
the following substantive additions and/or corrections have been proposed:
6565
p>
6666
<ul>
67+
<li>
68+
<a href="https://github.com/w3c/html-aria/pull/453">3 October 2023 - Correction:a>
69+
Update the <a href="#el-img">`img`a> element allowances to be based on whether the element is named, or not.
70+
li>
6771
<li>
6872
<a href="https://github.com/w3c/html-aria/pull/462">21 August 2023 - Addition:a>
6973
Update the <a href="#el-address">`address`a> and <a href="#el-hgroup">`hgroup`a> element allowances per their updated mapping to the `group` role.
@@ -1560,9 +1564,13 @@

15601564
tr>
15611565
<tr>
15621566
<th id="el-img" tabindex="-1">
1563-
[^img^] with [^img/alt^]`="some text"`
1567+
<div class="correction proposed">
1568+
[^img^] with an accessible name.
1569+
div>
15641570
th>
15651571
<td>
1572+
If the `img` has non-empty [^img/alt^] (`alt="some text"`) or an accessible name is provided another
1573+
<a data-cite="html-aam-1.0#img-element-accessible-name-computation">`img` naming methoda>:<br>
15661574
<code>role=<a href="#index-aria-img">imga>code>
15671575
td>
15681576
<td>
@@ -1574,6 +1582,9 @@

15741582
<a href="#index-aria-menuitem">`menuitem`a>,
15751583
<a href="#index-aria-menuitemcheckbox">`menuitemcheckbox`a>,
15761584
<a href="#index-aria-menuitemradio">`menuitemradio`a>,
1585+
<span class="addition">
1586+
<a href="#index-aria-meter">`meter`a>,
1587+
span>
15771588
<a href="#index-aria-option">`option`a>,
15781589
<a href="#index-aria-progressbar">`progressbar`a>,
15791590
<span class="correction">
@@ -1597,43 +1608,46 @@

15971608
td>
15981609
tr>
15991610
<tr>
1600-
<th id="el-img-empty-alt" tabindex="-1">
1601-
[^img^] with [^img/alt^]`=""`
1611+
<th id="el-img-no-name" tabindex="-1">
1612+
[^img^] with no accessible name.
16021613
th>
16031614
<td>
1604-
<code>role=<a href="#index-aria-presentation">presentationa>code>
1615+
<div class="proposed correction">
1616+
<p id="el-img-empty-alt">
1617+
If the `img` has an empty `alt` ([^img/alt^]`=""`) and lacks any other
1618+
<a data-cite="html-aam-1.0#img-element-accessible-name-computation">`img` naming methodsa>:<br>
1619+
<code>role=<a href="#index-aria-none">nonea>code>,
1620+
<code>role=<a href="#index-aria-presentation">presentationa>code>
1621+
p>
1622+
<p id="el-img-no-alt" tabindex="-1">
1623+
If the `img` <a data-cite="html/images.html#unknown-images">lacks an `alt` attributea> and lacks any other
1624+
<a data-cite="html-aam-1.0#img-element-accessible-name-computation">`img` naming methodsa>:<br>
1625+
<code>role=<a href="#index-aria-img">imga>code>
1626+
p>
1627+
div>
16051628
td>
16061629
<td>
1630+
<div class="correction proposed">
16071631
<p>
1608-
<a><strong class="nosupport">No `role`strong>a> other than <code><a href="#index-aria-presentation">presentationa>code>, which is NOT RECOMMENDED
1632+
If the `img` has no `alt` attribute or accessible name:
1633+
<a><strong class="nosupport">No `role`strong>a> other than the
1634+
<code>role=<a href="#index-aria-none">nonea>code> or <code><a href="#index-aria-presentation">presentationa>code> roles.
1635+
(<code>role=<a href="#index-aria-img">imga>code> is also allowed, but NOT RECOMMENDED.)
16091636
p>
16101637
<p>
1611-
<strong>No `aria-*` attributesstrong>
1612-
except <a data-cite="wai-aria-1.2#aria-hidden">`aria-hidden="true"`a>.
1613-
p>
1614-
td>
1615-
tr>
1616-
<tr>
1617-
<th id="el-img-no-alt" tabindex="-1">
1618-
[^img^] <a data-cite="html/images.html#unknown-images">without an `alt` attributea>
1619-
th>
1620-
<td>
1621-
<code>role=<a href="#index-aria-img">imga>code>
1622-
td>
1623-
<td>
1624-
<p>
1625-
If no <a data-cite="accname-1.2/#dfn-accessible-name">accessible namea> is provided via other
1626-
<a data-cite="html-aam-1.0#img-element-accessible-name-computation">`img` naming methodsa> (e.g., `aria-labelledby`, `aria-label`):
1627-
<a><strong class="nosupport">No `role`strong>a> other than <code><a href="#index-aria-img">imga>code>, which is NOT RECOMMENDED.
1638+
If the `img` has an empty `alt=""` attribute and no `aria-label` or `aria-labelledby` attributes to provide it an accessible name:
1639+
<a><strong class="nosupport">No `role`strong>a> other than the <code>role=<a href="#index-aria-none">nonea>code> or
1640+
<code><a href="#index-aria-presentation">presentationa>code> roles, which are NOT RECOMMENDED.
16281641
p>
16291642
<p>
16301643
<strong>No `aria-*` attributesstrong>
16311644
except <a data-cite="wai-aria-1.2#aria-hidden">`aria-hidden="true"`a>.
16321645
p>
16331646
<p>
16341647
Otherwise, if the `img` has an author defined accessible name,
1635-
see <a href="#el-img">`img` with `alt="some text"`a>.
1648+
see <a href="#el-img">`img` with an accessible namea>.
16361649
p>
1650+
div>
16371651
td>
16381652
tr>
16391653
<tr>

0 commit comments

Comments
 (0)