axe-core icon indicating copy to clipboard operation
axe-core copied to clipboard

valid-lang should check that there is actual content

Open WilcoFiers opened this issue 3 years ago • 2 comments

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 avatar May 19 '22 10:05 WilcoFiers

👋 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! 👍

MelSumner avatar May 26 '22 14:05 MelSumner

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!

WilcoFiers avatar May 26 '22 15:05 WilcoFiers

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

padmavemulapati avatar Sep 07 '22 05:09 padmavemulapati