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

Correction: conditionally revise allowed attributes and roles on summary element #435

Merged
merged 16 commits into from
May 31, 2023

Conversation

scottaohara
Copy link
Member

@scottaohara scottaohara commented Nov 2, 2022

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

Edit: after testing, aria-expanded and aria-pressed provide zero value on a summary element, as they are presently ignored by user agents (browsers/AT). https://codepen.io/scottohara/pen/ZEjZPoR

markup and results of linked codepen

<details open>
	<summary aria-pressed=false>test 1</summary>
	aria-pressed on summary element
</details>

<details open>
<summary aria-expanded=false>test 2</summary>
aria-expanded=false on summary element
</details>

<details open>
<summary aria-haspopup=dialog>test 3</summary>
aria-haspopup=dialog on summary element
</details>

<details open>
<summary aria-disabled=true>test 4</summary>
aria-disabled=true on summary element
</details>

test 1
JAWS/NVDA+Chromium/Gecko - attribute ignored
Narrator+Edge - attribute ignored / UIA ignores attr
iOS/macos safari/firefox+VO - ignored

test 2
JAWS/NVDA+Chromium/Gecko - attribute ignored
Narrator+Edge - attribute ignored / UIA ignores attr
iOS/macos safari/firefox+VO - ignored

test 3
JAWS/NVDA+Chromium/Gecko - announces as a button menu
Narrator+Edge - has popup
macOS VO + Safari - has popup
iOS VO + safari, macOS VO firefox - ignored

test 4
JAWS/NVDA+Chromium/Gecko - disabled state conveyed
Narrator+Edge - disabled
iOS/macOS Safari/firefox+VO - disabled

Concerning the allowed roles for a summary element. A summary element can be one of two things, the 'summary for its parent details' - where it acts as the triggering element for the disclosure widget. Or, if it doesn't meet the conditions to be that (e.g., it is not a child of a details element, or it is not the first instance of a summary element - e.g., it's the 2+ summary element within a details), then it is treated as a generic element, so any role/attribute should be allowed.

test cases - https://w3c.github.io/html-aria/tests/summary-allowances.html

  • HTML Validator
  • IBM equal access accessibility checker
  • axe-core
  • ARC toolkit

(linked issues to each checker referenced in the following thread)


Preview | Diff

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).
@scottaohara scottaohara added needs implementation commitment Cannot merge into spec until implementations in conformance checkers has been confirmed. needs changelog entry once 2 implementations land, we can merge and note it in our changelog. labels Nov 2, 2022
@JAWS-test

This comment was marked as resolved.

@scottaohara

This comment was marked as resolved.

@JAWS-test

This comment was marked as resolved.

@scottaohara

This comment was marked as resolved.

@JAWS-test

This comment was marked as resolved.

@JAWS-test

This comment was marked as resolved.

@scottaohara

This comment was marked as resolved.

@JAWS-test

This comment was marked as resolved.

move to the parent paragraph element, rather than being on a child span.
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.
@scottaohara scottaohara changed the title revise allowed attributes on summary element Correction: conditionally revise allowed attributes and roles on summary element Feb 7, 2023
@scottaohara scottaohara added Allowed roles Pertaining to the allowed roles of HTML elements Allowed aria-* attributes labels Feb 7, 2023
@scottaohara scottaohara merged commit bf5c04b into gh-pages May 31, 2023
@scottaohara scottaohara deleted the summary-element-attr-allowances branch May 31, 2023 14:34
@scottaohara scottaohara added Meets 2 implementations req Indicates that a spec change has met the necessary 2 implementations needed to merge. and removed needs changelog entry once 2 implementations land, we can merge and note it in our changelog. needs implementation commitment Cannot merge into spec until implementations in conformance checkers has been confirmed. labels May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Allowed aria-* attributes Allowed roles Pertaining to the allowed roles of HTML elements Meets 2 implementations req Indicates that a spec change has met the necessary 2 implementations needed to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants