ARIA in HTML - test cases for summary

last updated 13 February 2023

Tests:

Test 1

Authors can't use aria-expanded or aria-pressed attributes on a summary element if it serves as the summary for its parent details element.

An aria-expanded attribute is ignored by user agents

has aria-expanded=false attribute

An aria-pressed attribute is ignored by user agents

test 2 has aria-pressed=true attribute

Expected result:
As these attributes presently have no negative impact on the user experience, it seems that at the very least, conformance checkers should produce a warning about their use, since these 'were' previously 'allowed' but likely served no practical value then either. However, a conformance checker may expose these attributes as an error as well, as other allowed attribute checks that already exist may expose similar errors. E.g., div aria-expanded=true is another example of an invalid attribute being used on a generic element.

Test 2

Authors MAY specify any role on a summary element, so long as that summary element is not the 'summay for its parent details'.

The summary elements beyond the first instance do not pass the algorithm to be a summary for its parent details, so they are exposed as generic elements.

no allowed role on this summary this summary has a paragraph role, which is fine. this summary has a button role, which is also fine.

The following summary element is not a child of a details element, and thus is implicitly exposed as a generic.

this summary has a paragraph role, which is fine.

Expected result:
Conformance checkers need not throw an error for summary elements that are not the first instance of the element type within a details element, or are not a descendant element of a details element.

Test 3

Authors can use aria-disabled or aria-haspopup attributes on a summary element when it serves as the summary for its parent details element.

Using an aria-disabled attribute is allowed

test 1 has aria-disabled=true attribute

Using an aria-haspopup attribute is allowed

test 2 has aria-haspopup=true attribute

Expected result:
The aria-disabled and aria-haspopup attributes both have good support and are valid to use on the summary element when it acts as the interactive trigger for the details/summary disclosure widget. Other checks may be necessary to ensure that developers are using these attributes correctly, but that is beyond the scope of what ARIA in HTML covers.