Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
WilcoFiers opened this issue May 19, 2022 · 3 comments
Closed

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

WilcoFiers opened this issue May 19, 2022 · 3 comments
Assignees
Labels
ACT Rules fix Bug fixes pr A pr has been created for the issue
Milestone

Comments

@WilcoFiers
Copy link
Contributor

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>
@WilcoFiers WilcoFiers added this to the Axe-core 4.5 milestone May 19, 2022
@MelSumner
Copy link

👋 we used is-language-code when implementing the --lang flag in ember-cli. Sharing in case it's useful! Thank you for all you do! 👍

@WilcoFiers
Copy link
Contributor Author

Thanks Melanie! That looks a little too strict for what we want in axe-core though. Plus the size of it is a bit of an issue. Either way, appreciate the suggestion.

Glad you like our work, if you're ever interested to help, get in touch. I hear good things about your work on Ember too!

@padmavemulapati
Copy link

Validate with the latest develop branch code base,
test Script: <div id="target"><span lang="en"> text </span></div>
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ACT Rules fix Bug fixes pr A pr has been created for the issue
Projects
None yet
Development

No branches or pull requests

3 participants