Missing ARIA child role
Silktide checks container widgets built with ARIA roles, such as tab strips, menus, and listboxes, and verifies that each one contains the kind of items it is supposed to hold. A tab strip with no tabs, or a menu with no menu items, is announced as a widget but offers nothing to operate.
<!-- Problem: a tablist must contain elements with role="tab" -->
<div role="tablist">
<button>Overview</button>
</div>
<!-- Fix: give the children their required role -->
<div role="tablist">
<button role="tab">Overview</button>
</div>
Why this matters
Composite roles describe a widget as a whole:
tablist promises tabs, listbox promises options, menu promises menu
items. switch into
specialized navigation for these widgets, expecting the promised children.
When the children lack their roles, the widget announces itself and then
behaves as an empty shell - users can reach it but find nothing inside,
while sighted users see a fully working control.
How to fix it
- Add the required role to each item inside the container - for example,
role="tab"on each control inside arole="tablist". - If the items must live elsewhere in the code, connect them with
aria-ownson the container. - If the container is not really that kind of widget, remove or correct its role instead.
Common pairings: tablist needs tab; listbox needs option; menu
and menubar need menuitem (or its checkbox and radio variants);
radiogroup needs radio; tree needs treeitem; grid and table
need row; row needs cells or headers.
How Silktide tests this
- Find every element whose ARIA role requires specific child roles.
- Skip containers that are excluded from the
, because assistive
technology never meets them: hidden with
display: noneor thehiddenattribute,visibility: hiddenorcontent-visibility: hidden, or markedaria-hidden="true"orinert, on the container itself or on an element around it. - Skip containers marked
aria-busy="true", which are still loading their items. - Search each remaining container's descendants, including any elements
adopted with
aria-owns, for at least one element with a required child role. Native elements count with the role they have implicitly: a table row (<tr>) is satisfied by its<td>and<th>cells. - Report containers where none is found.
Troubleshooting
The items are loaded later by a script
Silktide tests the page as it loads. If a listbox or menu is populated only
on demand, it announces as empty until then; where possible, render at
least the initial items with the page. While a container is still loading
its items, mark it with aria-busy="true" and remove the attribute once the
items are in place. Silktide does not report a container marked busy.
The container stays hidden until it has items
A search box's list of suggestions is often empty until someone types.
Silktide does not report it while it is hidden with display: none, the
hidden attribute or aria-hidden="true", because assistive technology
does not meet it either. A container hidden only from sight, such as one
moved off-screen, made transparent or sized to nothing, is still exposed,
and is reported while it is empty: hide it with display: none or the
hidden attribute until it has items.