You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A closed <details> reads its hidden content, and its summary without button/collapsed #254
main, group, Plan details, paragraph, Hidden part, end of paragraph, end of group, end of main
Expected: the summary read as a collapsed button (for example button, Plan details, not expanded), and nothing from the content while the details is closed.
HTML-AAM maps the details' summary to a button whose expanded state follows the details' open attribute.
The HTML standard does not render a closed details' content beyond its summary, and Chromium's accessibility tree marks that content as not rendered, so screen readers do not read it. Reading it tells a user about content they cannot reach.
Environment: the browser bundle (@guidepup/virtual-screen-reader/browser.js) in Chromium 151 via Playwright 1.63, started with virtual.start({ container: document.body }), stepped with virtual.next().
[wai-aria-1.2] - No corresponding role Computed Role - If the element is the first child of its type within a parent details element: html-summary. Otherwise, if it is not the first child of its type of a parent details element, or it is not a child of a details element: generic role
The specific accessibility APIs (UIA, AX, etc.) do typically expose as some form of expand/collapse like button.
From memory/experience the expected role of summary element is somewhat contested, but my read is that officially it doesn't have an implicit role in the sense that this library typically exposes, and that user agents and assistive technologies have (because to many this feels like a gap given it is an interactive button like thing) made up their own choices on how to expose it (prompting the note in the ARIA in HTML spec).
Generally I've looked to be spec aligned and not implementation aligned (citation needed, probably not done this consistently!) which hints at us adopting the spec's No corresponding role definition for <summary> elements.
If you have spec or WPT links that speak to the contrary then please share and can reconsider!
R.E. "HTML standard does not render a closed details' content beyond its summary" need to have a deeper look, nothing stands out that can see from the aria related specs, but if HTML specs consider it not rendered then agree we should treat it like it's either not there!
This element is expected to have its style attribute set to "display: block; content-visibility: hidden;" when the details element does not have an open attribute. When it does have the open attribute, the style attribute is expected to be set to "display: block;".
Because the slots are hidden inside a shadow tree, this style attribute is not directly visible to author code. Its impacts, however, are visible. Notably, the choice of content-visibility: hidden instead of, e.g., display: none, impacts the results of various APIs that query layout information.
The "must not be accessible to user-agent features, such as find-in-page, tab-order navigation, etc., nor be selectable or focusable" and comparison to display: none settles it IMO, so I agree, we should omit the children of a collapsed <details> element from the constructed tree.
Activity
Speak through Guidepup's virtual screen reader instead of our own rul…
cmorten commentedon Oct 17, 2026
R.E. "the summary read as a collapsed button"
Some quote/refs from specs:
The specific accessibility APIs (UIA, AX, etc.) do typically expose as some form of expand/collapse like button.
REF: https://www.w3.org/TR/html-aam-1.0/#el-summary
REF: https://www.w3.org/TR/html-aria/#docconformance
From memory/experience the expected role of summary element is somewhat contested, but my read is that officially it doesn't have an implicit role in the sense that this library typically exposes, and that user agents and assistive technologies have (because to many this feels like a gap given it is an interactive button like thing) made up their own choices on how to expose it (prompting the note in the ARIA in HTML spec).
Generally I've looked to be spec aligned and not implementation aligned (citation needed, probably not done this consistently!) which hints at us adopting the spec's
No corresponding roledefinition for<summary>elements.If you have spec or WPT links that speak to the contrary then please share and can reconsider!
R.E. "HTML standard does not render a closed details' content beyond its summary" need to have a deeper look, nothing stands out that can see from the aria related specs, but if HTML specs consider it not rendered then agree we should treat it like it's either not there!
cmorten commentedon Oct 17, 2026
REF: https://html.spec.whatwg.org/multipage/rendering.html?utm_source=chatgpt.com#the-details-and-summary-elements
So the HTML described behaviour of a closed details-summary is to apply
content-visibility: hidden. This then points to:REF: https://www.w3.org/TR/css-contain-2/?utm_source=chatgpt.com#content-visibility
The "must not be accessible to user-agent features, such as find-in-page, tab-order navigation, etc., nor be selectable or focusable" and comparison to
display: nonesettles it IMO, so I agree, we should omit the children of a collapsed<details>element from the constructed tree.fix: omit the content of a closed details element from the tree (#266)
cmorten commentedon Oct 23, 2026
With #266 merged I believe this is complete.
Message if disagree (with citations!) r.e. the button role and we can discuss further!