Skip to content

Commit

Permalink
chore(meta-refresh): Avoid duplicates with meta-refresh-no-exception (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers authored Sep 26, 2022
1 parent 889778b commit 3f3edd6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion doc/rule-descriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
| [list](https://dequeuniversity.com/rules/axe/4.4/list?application=RuleDescription) | Ensures that lists are structured correctly | Serious | cat.structure, wcag2a, wcag131 | failure | |
| [listitem](https://dequeuniversity.com/rules/axe/4.4/listitem?application=RuleDescription) | Ensures <li> elements are used semantically | Serious | cat.structure, wcag2a, wcag131 | failure | |
| [marquee](https://dequeuniversity.com/rules/axe/4.4/marquee?application=RuleDescription) | Ensures <marquee> elements are not used | Serious | cat.parsing, wcag2a, wcag222 | failure | |
| [meta-refresh](https://dequeuniversity.com/rules/axe/4.4/meta-refresh?application=RuleDescription) | Ensures <meta http-equiv="refresh"> is not used for delayed refresh | Critical | cat.time-and-media, wcag2a, wcag221, wcag224, wcag325 | failure | [bc659a](https://act-rules.github.io/rules/bc659a) |
| [meta-refresh](https://dequeuniversity.com/rules/axe/4.4/meta-refresh?application=RuleDescription) | Ensures <meta http-equiv="refresh"> is not used for delayed refresh | Critical | cat.time-and-media, wcag2a, wcag221 | failure | [bc659a](https://act-rules.github.io/rules/bc659a) |
| [nested-interactive](https://dequeuniversity.com/rules/axe/4.4/nested-interactive?application=RuleDescription) | Ensures interactive controls are not nested as they are not always announced by screen readers or can cause focus problems for assistive technologies | Serious | cat.keyboard, wcag2a, wcag412 | failure, needs review | [307n5z](https://act-rules.github.io/rules/307n5z) |
| [no-autoplay-audio](https://dequeuniversity.com/rules/axe/4.4/no-autoplay-audio?application=RuleDescription) | Ensures <video> or <audio> elements do not autoplay audio for more than 3 seconds without a control mechanism to stop or mute the audio | Moderate | cat.time-and-media, wcag2a, wcag142, ACT | needs review | [80f0bf](https://act-rules.github.io/rules/80f0bf) |
| [object-alt](https://dequeuniversity.com/rules/axe/4.4/object-alt?application=RuleDescription) | Ensures <object> elements have alternate text | Serious | cat.text-alternatives, wcag2a, wcag111, section508, section508.22.a | failure, needs review | [8fc3b6](https://act-rules.github.io/rules/8fc3b6) |
Expand Down
2 changes: 1 addition & 1 deletion lib/checks/navigation/meta-refresh-no-exceptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "meta-refresh-no-exceptions",
"evaluate": "meta-refresh-evaluate",
"options": {
"minDelay": 0,
"minDelay": 72000,
"maxDelay": false
},
"metadata": {
Expand Down
8 changes: 1 addition & 7 deletions lib/rules/meta-refresh.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
"id": "meta-refresh",
"selector": "meta[http-equiv=\"refresh\"][content]",
"excludeHidden": false,
"tags": [
"cat.time-and-media",
"wcag2a",
"wcag221",
"wcag224",
"wcag325"
],
"tags": ["cat.time-and-media", "wcag2a", "wcag221"],
"actIds": ["bc659a"],
"metadata": {
"description": "Ensures <meta http-equiv=\"refresh\"> is not used for delayed refresh",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<head>
<meta charset="utf8" />
<title>Meta-refresh-no-exceptions fail 1</title>
<meta http-equiv="refresh" content="10 https://deque.com/">
<!-- Greater than 20 hour is still not allowed at Level AAA -->
<meta http-equiv="refresh" content="90000; https://deque.com/" />
<link
rel="stylesheet"
type="text/css"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="utf8" />
<title>Meta-refresh-no-exceptions pass 1</title>
<!-- "-10" is not valid, this will be ignored -->
<meta http-equiv="refresh" content="-10 https://deque.com/">
<!-- invalid, but will be caught by meta-refresh -->
<meta http-equiv="refresh" content="10 https://deque.com/" />
<link
rel="stylesheet"
type="text/css"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="utf8" />
<title>Meta-refresh-no-exceptions fail 2</title>
<!-- Greater than 20 hour is still not allowed at Level AAA -->
<meta http-equiv="refresh" content="90000; https://deque.com/">
<title>Meta-refresh-no-exceptions pass 2</title>
<!-- "-10" is not valid, this will be ignored -->
<meta http-equiv="refresh" content="-10 https://deque.com/" />
<link
rel="stylesheet"
type="text/css"
Expand All @@ -23,7 +23,7 @@
</head>
<body>
<div id="mocha"></div>
<script src="meta-refresh-fail.js"></script>
<script src="meta-refresh-pass.js"></script>
<script src="/test/integration/adapter.js"></script>
</body>
</html>
24 changes: 12 additions & 12 deletions test/integration/virtual-rules/meta-refresh-no-exceptions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('meta-refresh-no-exceptions virtual-rule', function() {
it('should be inapplicable for missing content', function() {
describe('meta-refresh-no-exceptions virtual-rule', function () {
it('should be inapplicable for missing content', function () {
var results = axe.runVirtualRule('meta-refresh-no-exceptions', {
nodeName: 'meta',
attributes: {
Expand All @@ -13,7 +13,7 @@ describe('meta-refresh-no-exceptions virtual-rule', function() {
assert.lengthOf(results.inapplicable, 1);
});

it('should pass for content=0', function() {
it('should pass for content=0', function () {
var results = axe.runVirtualRule('meta-refresh-no-exceptions', {
nodeName: 'meta',
attributes: {
Expand All @@ -27,7 +27,7 @@ describe('meta-refresh-no-exceptions virtual-rule', function() {
assert.lengthOf(results.incomplete, 0);
});

it('should pass for content=0 and url', function() {
it('should pass for content=0 and url', function () {
var results = axe.runVirtualRule('meta-refresh-no-exceptions', {
nodeName: 'meta',
attributes: {
Expand All @@ -41,26 +41,26 @@ describe('meta-refresh-no-exceptions virtual-rule', function() {
assert.lengthOf(results.incomplete, 0);
});

it('should fail for content other than 0', function() {
it('should pass for content equal to 72000', function () {
var results = axe.runVirtualRule('meta-refresh-no-exceptions', {
nodeName: 'meta',
attributes: {
'http-equiv': 'refresh',
content: '300'
content: '72000'
}
});

assert.lengthOf(results.passes, 0);
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.passes, 1);
assert.lengthOf(results.violations, 0);
assert.lengthOf(results.incomplete, 0);
});

it('should fail for content other than 0 and url', function() {
it('should fail for content other greater than 72000', function () {
var results = axe.runVirtualRule('meta-refresh-no-exceptions', {
nodeName: 'meta',
attributes: {
'http-equiv': 'refresh',
content: '20;url=http://example.com/'
content: '72001'
}
});

Expand All @@ -69,12 +69,12 @@ describe('meta-refresh-no-exceptions virtual-rule', function() {
assert.lengthOf(results.incomplete, 0);
});

it('should fail for content greater than 20 hours', function() {
it('should fail for content other than 0 and url', function () {
var results = axe.runVirtualRule('meta-refresh-no-exceptions', {
nodeName: 'meta',
attributes: {
'http-equiv': 'refresh',
content: '72001'
content: '72001;url=http://example.com/'
}
});

Expand Down

0 comments on commit 3f3edd6

Please sign in to comment.