Skip to content

valid-lang should check that there is actual content #3465

@WilcoFiers

Description

@WilcoFiers

For consistency with the Element with lang attribute has valid language tag ACT rule, axe-core should make sure that the valid-lang rule does not fail elements that are empty, or that only contain whitespace characters.

Here are some of the ACT example we're failing, when we shouldn't be:

Passed example 4

<article lang="invalid">
  <div lang="en">
    They wandered into a strange Tiki bar on the edge of the small beach town.
  </div>
</article>

Inapplicable example 3

<p lang="hidden">
  <span style="display: none;">
    They wandered into a strange Tiki bar on the edge of the small beach town.
  </span>
</p>

Inapplicable example 4

<div lang="invalid">
  <img src="/WAI/content-assets/wcag-act-rules/test-assets/shared/fireworks.jpg" alt="" />
</div>

Metadata

Metadata

Assignees

Labels

ACT RulesfixBug fixesprA pr has been created for the issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions