Skip to content

Commit

Permalink
Correction: conditionally revise allowed attributes and roles on summ…
Browse files Browse the repository at this point in the history
…ary element (#435)

* revise allowed attributes on summary element

Normative follow-on from #434

The spec was updated to note that the summary element doesnt' always map to the button element.  The allowed attributes indicated that all attributes that were applicable to the button role were allowed.  However, in practice this doesn't make sense and could break or be in contradiction to the implicit semantics.

The allowed aria-* attributes for the button role include 
* aria-disabled
* aria-haspopup
* aria-expanded
* aria-pressed

Of those four, aria-expanded and pressed are the ones that would pose problems by conflicting or not making any sense with the implicit expanded/collapsed states provided by the element (who gets the state per the parent details having an open attribute or not).

* further clarifications for summary element allowances
this addition to the PR takes into account that only a summary element that serves as the 'summary for its parent details' needs to adhere to these rules.
otherwise, a summary element that doesn't meet the criteria of the HTML spec is essentially just a generic element, so any roles/attributes can be used on that.


* updated changelog
  • Loading branch information
scottaohara authored May 31, 2023
1 parent 55bab95 commit 0345d83
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions html-aria/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
the following substantive additions and/or corrections have been proposed:
</p>
<ul>
<li>
<a href="https://github.com/w3c/html-aria/pull/435">31 May 2023 - Correction:</a>
Conditionally revise allowed `aria-*` attributes and roles on <a href="#el-summary">`summary`</a> element.
</li>
<li>
<a href="https://github.com/w3c/html-aria/pull/410">31 May 2023 - Correction:</a>
Update <a href="#el-li">`li`</a> element role allowances in context to the element's ancestral relationship, or lack of,
Expand Down Expand Up @@ -2939,18 +2943,26 @@ <h2 id="docconformance">
<a>No corresponding role</a>
</p>
<div class="note">
Many, but not all, user agents expose the `summary` element with an implicit ARIA <code>role=<a href="#index-aria-button">button</a></code>
role.
Many, but not all, user agents expose the `summary` element with an implicit ARIA
<code>role=<a href="#index-aria-button">button</a></code>.
</div>
</td>
<td>
<p>
<a><strong class="nosupport">No `role`</strong></a>
</p>
<p>
<a data-cite="wai-aria-1.2#global_states">Global `aria-*` attributes</a>
and any `aria-*` attributes applicable to the `button` role.
</p>
<div class="proposed correction">
<p>
<a><strong class="nosupport">No `role`</strong></a> if the `summary` element is a
<a data-cite="html/interactive-elements.html#summary-for-its-parent-details">summary for its parent details</a>.
</p>
<p>
<a data-cite="wai-aria-1.2#global_states">Global `aria-*` attributes</a>,
`aria-disabled`, and `aria-haspopup` attributes.
</p>
<p>
Otherwise, authors MAY specifiy <a><strong>Any `role`</strong></a>, and any
<a data-cite="wai-aria-1.2#global_states">global `aria-*` attributes</a>
and any `aria-*` attributes applicable to the allowed roles.
</p>
</div>
</td>
</tr>
<tr>
Expand Down

0 comments on commit 0345d83

Please sign in to comment.