Open Bug 1790056 Opened 3 years ago Updated 2 years ago

Invalid summary elements should not be exposed as interactive

Categories

(Firefox :: Disability Access, defect)

defect

Tracking

()

People

(Reporter: scottaohara, Unassigned)

References

(Blocks 1 open bug)

Details

If a summary element is misused - e.g., specified outside of a details element, or multiple summary elements are specified within a details element, the errant summary element(s) are not rendered as interactive elements (good). However, Firefox still exposes them as interactive elements, which is not reflective of their behavior.

For instance, the following codepen has a summary element without a details parent, as well as two summary elements within a details parent https://codepen.io/scottohara/pen/poVyeNV

The invalid summary elements are visually rendered as static text with a list marker bullet (also giving the false impression these are list items). But as they are not interactive, they should be exposed as generic elements.

I've made a PR to HTML AAM to clarify this in the spec as well.
https://github.com/w3c/html-aam/pull/436

Blocks: html5a11y
Severity: -- → S4

Implementation thoughts: How do we determine whether a summary element is invalid? One possibility is to look at the focusable state. If it's not focusable, don't expose the relevant role and states. We shouldn't alter the creation logic, though, as it might become valid later; e.g. if it was the second summary element but the first got removed.

It's "invalid" if https://html.spec.whatwg.org/#summary-for-its-parent-details returns false.

The UA stylesheet implements it (for rendering the disclosure triangle) using the selector details > summary:first-of-type

You need to log in before you can comment on or make changes to this bug.