ARIA tab nodes must have an accessible name
How to Fix the Problem
Correct markup solutions
The aria-tab-name rule has four markup patterns that pass test
criteria:
<div role="tab" id="text">Settings</div>
<div role="tab" id="al" aria-label="Settings"></div>
<div role="tab" id="alb" aria-labelledby="labeldiv"></div>
<div id="labeldiv">Settings</div>
<div role="tab" id="title" title="Settings"></div>
-
Ensure that each element with
role="tab"has one of the following characteristics:- Inner text that is discernible to screen reader users.
- Non-empty
aria-labelattribute. -
aria-labelledbypointing to element with text which is discernible to screen reader users. - Non-empty
titleattribute.
Incorrect markup solutions
The aria-tab-name rule has four markup patterns that fail
testing criteria:
<div role="tab" id="empty"></div>
<div role="tab" id="alempty" aria-label=""></div>
<div role="tab" id="albmissing" aria-labelledby="nonexistent"></div>
<div role="tab" id="albempty" aria-labelledby="emptydiv"></div>
<div id="emptydiv"></div>
Why it Matters
Screen reader users are not able to discern the purpose of elements with
role="tab" that do not have an accessible name.
Rule Description
ARIA tab elements must have discernible text that clearly describes the purpose or function of the tab for screen reader users.
The Algorithm (in simple terms)
Checks all elements with role="tab" to ensure that they have a
discernable, accessible name.
