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

xml:lang not handled correctly #4267

Closed
1 task done
mirabilos opened this issue Dec 4, 2023 · 2 comments
Closed
1 task done

xml:lang not handled correctly #4267

mirabilos opened this issue Dec 4, 2023 · 2 comments
Labels
ungroomed Ticket needs a maintainer to prioritize and label

Comments

@mirabilos
Copy link

Product

axe-core

Product Version

No response

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

https://www.webpagetest.org links to https://dequeuniversity.com/rules/axe/4.4/html-has-lang?application=axeAPI describing that the html tag must have a lang attribute.

This is not true, however, for XHTML documents even if served as HTML because the DTD doesn’t have lang but xml:lang only.

And yes, it’s totally okay to serve XHTML documents written in compatibility mode (e.g. with space before />) as text/html; in fact, this is good as recommended nowadays because it’s less buggy. It may not help the latest browsers as much as serving it as XML, but it does help authoring tools or download postprocessing tools which can go straight at it in XML.

@mirabilos mirabilos added the ungroomed Ticket needs a maintainer to prioritize and label label Dec 4, 2023
@WilcoFiers
Copy link
Contributor

Axe-core's page-has-lang rule does allow xml:lang on XHTML doctype. These rule help pages aren't necessarily fully documenting everything the rule will do. They are designed to help developers solve a problem. Adding a lang attribute solves the problem, even if in some niche cases there is a second option.

Support for xml:lang in browsers and screen readers has been decreasing over the last few years. None of the major browser+AT combinations still support xml:lang in an HTML document, and they currently all prioritise lang over xml:lang if both exist in a page served with application/xhtml+xml.

@mirabilos
Copy link
Author

mirabilos commented Dec 5, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ungroomed Ticket needs a maintainer to prioritize and label
Projects
None yet
Development

No branches or pull requests

2 participants