act-rules.github.io icon indicating copy to clipboard operation
act-rules.github.io copied to clipboard

"label and name from content mismatch" needs to also fail split up labels [2ee8b8]

Open ShadowBB opened this issue 6 years ago • 4 comments

The "label content name mismatch" rule is now only applicable when there is an aria-label or aria-labelledby attribute. But this means it won't fail when situations where the visible text content and accessible name mismatch when there is no aria involved.

In addition I think it is best to give explicit examples where visible labels are split up by invisible parts of the accessible name. For example:

<a href="home.html"> link <span style="sr-only">that opens a new screen</span> to the homepage</a>

In contrast we could limit the scope of the rule to just cases with aria. But if we choose to do so we should definitely only look at non-empty aria-labels. (and we should also make it explicit that if the visible name is contained in the accessible name but with other content in between, it should still fail).

https://auto-wcag.github.io/auto-wcag/rules/SC2-5-3-label-content-name-mismatch.html

ShadowBB avatar Mar 19 '19 14:03 ShadowBB

... and have something like this as applicable + passed:

<a href="home.html">Read more<span style="sr-only"> about our pricing</span></a>

annethyme avatar Mar 21 '19 08:03 annethyme

Working on it in this pull request: https://github.com/auto-wcag/auto-wcag/pull/452

annethyme avatar Mar 22 '19 16:03 annethyme

Reopening issue since (inactive) PR has been closed.

Jym77 avatar May 15 '20 09:05 Jym77

Related to #1619

WilcoFiers avatar Nov 02 '21 10:11 WilcoFiers