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

excluding "valid-lang" rule from a11ycheck #219

Closed
devarshipant opened this issue Aug 30, 2016 · 6 comments
Closed

excluding "valid-lang" rule from a11ycheck #219

devarshipant opened this issue Aug 30, 2016 · 6 comments

Comments

@devarshipant
Copy link

Hi All,

On executing the script to exclude the valid-lang check, the lang test still runs in the console despite disabling it under 'rules.'

Any advise will be appreciated.

thanks!

Here it is:
axe.a11yCheck(document, {
runOnly: {
type: "tag",
values: ["wcag2a"]
},
"rules": {
"color-contrast": { enabled: true },
"valid-lang": { enabled: false },
}
}, function(results) {
console.log(results);
});

@marcysutton
Copy link
Contributor

That rule was split in two and changed names. You found something we need to fix in our documentation! Here are the correct rules to disable HTML lang:

html-has-lang
html-lang-valid

@devarshipant
Copy link
Author

devarshipant commented Aug 30, 2016

html-lang-valid or html-lang-invalid?

Thanks!

@marcysutton
Copy link
Contributor

Actually, I misspoke. It was broken into three separate rules. html-has-lang and html-lang-valid check the HTML element, while valid-lang checks everything else. Can you elaborate with more details about the results returned?

@devarshipant
Copy link
Author

devarshipant commented Aug 31, 2016

I am interested in running snippet #4 under https://github.com/dequelabs/axe-core/blob/master/doc/API.md#options-parameter-examples -

{
runOnly: {
type: "tag",
values: ["wcag2a"]
},
"rules": {
"color-contrast": { enabled: true },
"valid-lang": { enabled: false }
}
}

I haven’t been able to run the set. In addition, when I pass the selector for the entire doc and enable all rules, it only runs under IE 9.

@marcysutton
Copy link
Contributor

marcysutton commented Aug 31, 2016

I ran a test against some basic HTML markup with that config and I don't see valid-lang running at all. Can you post the HTML you're running it against? Here is my config, which I embedded in a script tag in an HTML document:

var config = {
  runOnly: {
    type: "tag",
    values: ["wcag2a"]
  },
  "rules": {
    "color-contrast": { enabled: true },
    "valid-lang": { enabled: false }
  }
}
axe.a11yCheck(document, config, function(results) {
  console.dir(results.violations);
});

With this markup:

<html lang="en">
<head>
    <title>Page title</title>
</head>
<body>
<header role="banner">
  <h1>HEY</h1>
</header>
<main role="main">
<div lang="derp">
  <a href="#menu" style="color:#ccc;">
    Menu
  </a>
</div>
</main>
</body>
</html>

That only triggers one failure: color-contrast. valid-lang is skipped, per the config. And again, it's looking at lang in the body–not at the HTML tag. That is covered by two separate rules.

In addition, when I pass the selector for the entire doc and enable all rules, it only runs under IE 9.

That sounds like a separate issue, definitely requiring more details.

@devarshipant
Copy link
Author

devarshipant commented Sep 1, 2016

Ok, the valid-lang works. I have attached the html file. I interesting to note the color contrast violation that gets flagged, which is same as given by WAT Analyzer. Also, note another rule I added “skip-link:” {enabled: true }, but did not see it flagged.

Thanks!

mrtnvh pushed a commit to mrtnvh/axe-core that referenced this issue Nov 24, 2023
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. **This update includes a security fix.**
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Michael <45568605+michael-siek@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants