Product
axe-core
Product Version
4.4.2
Latest Version
Issue Description
For <html lang="">, html-has-lang fails, and html-lang-valid passes. This is a similar issue to #3623, where I would expect the rules to be consistent with one-another.
Expectation
Both rules should be consistent. If lang="" is indeed a valid lang attribute value, then html-has-lang should pass (both rules should pass). If it’s not a valid value, then either both rules should fail, or only html-lang-valid should fail.
Actual
Currently, <html lang=""> passes html-lang-valid.
How to Reproduce
Here are two sites where this happens, and Axe CLI commands:
axe -r html-has-lang,html-lang-valid https://www.koldijkbv.nl/ --save empty-lang.json
axe -r html-has-lang,html-lang-valid https://loyalty.posnania.eu/ --save empty-lang.json
In each case, see the html-has-lang violation while html-lang-valid is marked as a "pass".
Additional context
Similarly to #3623, I was also tempted to report this to Lighthouse instead / in addition to Axe, as its overly simplified audit messages make this even more confusing. It would report:
- An error "
<html> element does not have a [lang] attribute"
- And a pass "
<html> element has a valid value for its [lang] attribute"
Product
axe-core
Product Version
4.4.2
Latest Version
Issue Description
For
<html lang="">,html-has-langfails, andhtml-lang-validpasses. This is a similar issue to #3623, where I would expect the rules to be consistent with one-another.Expectation
Both rules should be consistent. If
lang=""is indeed a valid lang attribute value, thenhtml-has-langshould pass (both rules should pass). If it’s not a valid value, then either both rules should fail, or onlyhtml-lang-validshould fail.Actual
Currently,
<html lang="">passeshtml-lang-valid.How to Reproduce
Here are two sites where this happens, and Axe CLI commands:
In each case, see the
html-has-langviolation whilehtml-lang-validis marked as a "pass".Additional context
Similarly to #3623, I was also tempted to report this to Lighthouse instead / in addition to Axe, as its overly simplified audit messages make this even more confusing. It would report:
<html> element does not have a [lang] attribute"<html> element has a valid value for its [lang] attribute"