Skip to content

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

Open
@ShadowBB

Description

@ShadowBB

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    RuleUse this label for a new rule that does not exist alreadyRule UpdateUse this label for an existing rule that is being updated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions