Do not let accessible names contradict visible labels
A button says Go on the screen and its accessible name says Find in this site, so a speech-input user says click Go and nothing happens. F96 is the failure technique for that, and a match is a defect rather than a technique. The test is containment rather than equality, which matters more than it sounds. The accessible name has to contain the visible text, so a name of Search products on a button reading Search passes cleanly, and a name of Find in this site on a button reading Go does not. Putting the visible words at the start of the name is best practice rather than a requirement. This failure is almost always built by someone trying to help, too. Hidden text, aria-label and aria-labelledby all exist to give assistive technology more context, and overwriting the visible label with better wording is how that good intention breaks voice control.
How we find it in an audit
Every control carrying both a visible label and an author-supplied name gets compared, which is the whole of the check. We read the accessible name out of the accessibility tree and test whether the visible string sits inside it, character for character, rather than close enough to pass a glance. Search boxes whose button says Go are the usual source, and so are icon buttons with a caption underneath. On a sample we then speak the visible label as a voice command, because that is the failure the rule exists to prevent.
How affected users experience it
Speech-input users say what they can see, because the visible word is the only handle they have. When the name behind it says something else, the command misses and nothing tells them why. They repeat it, then spell it, then go hunting for a numbered grid overlay so they can click by coordinates instead. Screen-reader users meet a quieter version of the same split, where the page reads Find in this site aloud while a colleague beside them is looking at a button marked Go, and neither of them can describe the screen to the other.
Passes vs. fails
Passes
<button aria-label="Search products">Search</button> <!-- the visible word opens the name -->Fails
<button aria-label="Submit query">Search</button>How this gets tested
The W3C publishes test rules that define what a checker looks for here.
- Form field has non-empty accessible nameA tool can check this
- Visible label is part of accessible nameNothing implements this yet
The other techniques filed under this rule
5 guides on this site are filed under 2.5.3 Label in Name. W3C documents this one as a failure of that rule, so it describes a way the rule gets broken rather than a way to pass it.
This guide is our interpretation of W3C technique F96: Failure due to the accessible name not containing the visible label text. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.