Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition: Prohibit naming of elements #402

Merged
merged 19 commits into from
Apr 3, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3052,6 +3052,43 @@ <h2 id="docconformance">
&lt;/figure&gt;
</pre><!-- source: http://www.geocities.com/SoHo/7373/aquatic.htm#fish -->
</aside>
<section class="proposed addition">
<h3 id="docconformance-naming">
Requirements for use of ARIA attributes to name <!-- and describe --> elements
</h3>
<!-- <section>
<h4>Elements with implicit ARIA roles which prohibit naming</h4> -->
<p>
Authors MAY use <a data-cite="wai-aria-1.2/#aria-label">`aria-label`</a> and <a data-cite="wai-aria-1.2/#aria-labelledby">`aria-labelledby`</a> attributes to specify <a data-cite="accname-1.2/#dfn-accessible-name">accessible names</a> for elements which have an implicit or explicit ARIA role which allows naming from authors. [[[wai-aria-1.2]]] defines <a data-cite="wai-aria-1.2/#namefromprohibited">roles which cannot be named</a>.
</p>
<p>
Authors MUST NOT specify `aria-label` or `aria-labelledby` on elements that expose an ARIA role which cannot be named. Elements whose implicit ARIA roles prohibit naming from authors are identified in [[[#docconformance]]].
patrickhlauke marked this conversation as resolved.
Show resolved Hide resolved
</p>
<p>
The following markup example demonstrates a selection of HTML elements with implicit ARIA roles that prohibit naming from authors.
patrickhlauke marked this conversation as resolved.
Show resolved Hide resolved
</p>
<pre class="HTML example" title="Elements with implicit ARIA roles which prohibit naming from authors">
patrickhlauke marked this conversation as resolved.
Show resolved Hide resolved
&lt;!-- DO NOT do the following! -->
&lt;p aria-label="...">...&lt;/p>

&lt;span aria-label="...">...&lt;span>

&lt;code aria-label="...">...&lt;code>

&lt;div aria-labelledby="...">...&lt;/div>
</pre>
<p>
The following markup example demonstrates elements which have explicit ARIA roles which allow naming from authors, and thus `aria-label` and `aria-labelledby` attributes are allow.
patrickhlauke marked this conversation as resolved.
Show resolved Hide resolved
</p>
<pre class="HTML example" title="Elements with explicit ARIA roles which allow naming from authors">
patrickhlauke marked this conversation as resolved.
Show resolved Hide resolved
&lt;p role="link" tabindex="0" aria-label="...">...&lt;/p>

&lt;span role="button" tabindex="0" aria-label="...">...&lt;span>

&lt;div role="article" aria-labelledby="...">...&lt;/div>
</pre>
<!-- </section> -->
</section>
<section>
<h3 id="docconformance-attr">
Requirements for use of ARIA attributes in place of equivalent HTML attributes
Expand Down