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

New rule: xml-lang-mismatch #558

Closed
jmucha opened this issue Oct 4, 2017 · 3 comments
Closed

New rule: xml-lang-mismatch #558

jmucha opened this issue Oct 4, 2017 · 3 comments
Labels
rules Issue or false result from an axe-core rule

Comments

@jmucha
Copy link

jmucha commented Oct 4, 2017

Update:

A detailed rule description with test cases can be found here: https://auto-wcag.github.io/auto-wcag/rules/SC3-1-1-html-xml-lang-match.html

Language of parts: xml-lang-mismatch

This test checks the value of the xml:lang attribute and the presence of the lang attribute.

Tags: wcag2a, wcag311, cat.language

Selector

descendent-or-self::body[@xml:lang][@lang]

Checks

language/xml-lang

  1. Check that the value of the xml:lang attribute is equal to the lang attribute. If true, pass; else 2.

language/xml-lang-dialects

  1. Check that the language can match different dialects, e.g.
  • <html lang="en" xml:lang="en-US">
  • <html xml:lang="nl" lang="nl-BE">

If true, pass; else fail.

@marcysutton marcysutton added the rules Issue or false result from an axe-core rule label Oct 5, 2017
@WilcoFiers
Copy link
Contributor

Proposed name: xml-lang-mismatch

@jmucha jmucha changed the title New rule: language-of-parts New rule: xml-lang-mismatch Nov 16, 2017
@jeeyyy
Copy link
Contributor

jeeyyy commented Aug 15, 2018

Proposed name has been updated to html-xml-lang-mismatch.
PR - #999

WilcoFiers pushed a commit that referenced this issue Aug 16, 2018
The rule checks that for the html element, there is no mismatch between the primary language in non-empty lang and xml:lang attributes, if both are used.

See also - https://auto-wcag.github.io/auto-wcag/rules/SC3-1-1-html-xml-lang-match.html for further details of the rule.

Closes issue:
- #558

## Reviewer checks

**Required fields, to be filled out by PR reviewer(s)**
- [x] Follows the commit message policy, appropriate for next version
- [x] Has documentation updated, a DU ticket, or requires no documentation change
- [x] Includes new tests, or was unnecessary
- [x] Code is reviewed for security by: @WilcoFiers
@WilcoFiers
Copy link
Contributor

Rule was completed. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

4 participants