Allow headings in <summary> elements for <details>
Currently, headings in <summary> elements are not allowed and do not show up in the accessibility tree as headings. For accordions and other use cases, using headings inside the <summary> makes a lot of sense. Navigating to a heading inside the summary should set the focus to the summary and then have the expected interaction to open and close the details element.
@whatwg/a11y are there any issues with AT with allowing headings in summary?
I think the issue is that summary is exposed as a button in the a11y tree, and buttons can only have plain text. So long as that is the case we can't allow headings (same as with button element).
headings are presently allowed, but per the way this has been implemented they don't always get exposed. this is related to https://github.com/whatwg/html/issues/2272
FYI it's more of an AT issue with more appropriate role for this use case missing, see the discussions around this topic in general: https://github.com/w3c/aria/issues/939#issuecomment-1656739513
Headings in <summary> have been allowed for about a decade at least. That is they have been valid for as log as the Internet Archive's Wayback Machine reaches back for the currently relevant spec page: https://web.archive.org/web/20141013114912/https://html.spec.whatwg.org/multipage/forms.html#the-summary-element