Skip to content

ARIA in HTML update for summary element allowances #1301

@scottaohara

Description

@scottaohara

ARIA in HTML is updating to clarify the ARIA attribute allowances for the summary element:

The summary currently allows no role, and any global aria-* attributes, and any aria-* attributes applicable to the button role.

The update changes this to indicate that no role is allowed so long as the summary element serves as the summary for its parent details element. However, Any role will be allowed on the element if it does not meet this requirement.

For instance, the following would continue to disallow any role from developers, as applying roles can cause AT to no longer correctly expose the current state of the disclosure widget:

<details>
  <summary>no role allowed</summary>
  ...
</details>

But the following examples demonstrate where any role may be applied to the summary element, as it does not meet HTML's conditions to be considered the summary for its parent details.

<details>
  <summary>
  	no role allowed on this summary, as it is the first instance of the summary
  	element within the details element, and thus browsers treat this as the 
  	summary / trigger to open/close the disclosure widget.
  </summary>

  <summary role=paragraph>
   any role is allowed on this summary element because it is ignored as a summary
   element by browsers, and instead returned as a generic element.
  </summary>
</details>

<summary role=group>
  this summary element also allows any role because it is not a child to a 
  details element, and thus is exposed as a generic by browsers.
</summary>

As the summary element is not consistently exposed as a button by all browsers, AND not all of the allowed ARIA attributes for button element even work on this element, the allowed attributes have been modified to reflect this.

If the summary element acts as the summary for its parent details, then global aria attributes and the aria-haspopup and aria-disabled attribute may be specified. Note that aria-expanded and aria-pressed are the attributes no longer allowed, and per testing, these attributes were not respected anyway.

If the summary element is not the summary for its parent details, then any global aria attributes and any attribute applicable to the allowed specified role may be used.

Additional examples and test cases can be viewed here:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions