diff --git a/doc/rule-descriptions.md b/doc/rule-descriptions.md index de23bdb574..a540a8b463 100644 --- a/doc/rule-descriptions.md +++ b/doc/rule-descriptions.md @@ -55,7 +55,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 | 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, wcag224, wcag325 | 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) | | [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) | | [role-img-alt](https://dequeuniversity.com/rules/axe/4.4/role-img-alt?application=RuleDescription) | Ensures [role='img'] elements have alternate text | Serious | cat.text-alternatives, wcag2a, wcag111, section508, section508.22.a, ACT | failure, needs review | [23a2a8](https://act-rules.github.io/rules/23a2a8) | @@ -116,10 +116,11 @@ Rules that do not necessarily conform to WCAG success criterion but are industry Rules that check for conformance to WCAG AAA success criteria that can be fully automated. -| Rule ID | Description | Impact | Tags | Issue Type | ACT Rules | -| :--------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------- | :------ | :-------------------------------- | :------------------------- | :------------------------------------------------- | -| [color-contrast-enhanced](https://dequeuniversity.com/rules/axe/4.4/color-contrast-enhanced?application=RuleDescription) | Ensures the contrast between foreground and background colors meets WCAG 2 AAA contrast ratio thresholds | Serious | cat.color, wcag2aaa, wcag146, ACT | failure, needs review | [09o5cg](https://act-rules.github.io/rules/09o5cg) | -| [identical-links-same-purpose](https://dequeuniversity.com/rules/axe/4.4/identical-links-same-purpose?application=RuleDescription) | Ensure that links with the same accessible name serve a similar purpose | Minor | cat.semantics, wcag2aaa, wcag249 | needs review | [b20e66](https://act-rules.github.io/rules/b20e66) | +| Rule ID | Description | Impact | Tags | Issue Type | ACT Rules | +| :--------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------- | :------ | :--------------------------------------------- | :------------------------- | :------------------------------------------------- | +| [color-contrast-enhanced](https://dequeuniversity.com/rules/axe/4.4/color-contrast-enhanced?application=RuleDescription) | Ensures the contrast between foreground and background colors meets WCAG 2 AAA contrast ratio thresholds | Serious | cat.color, wcag2aaa, wcag146, ACT | failure, needs review | [09o5cg](https://act-rules.github.io/rules/09o5cg) | +| [identical-links-same-purpose](https://dequeuniversity.com/rules/axe/4.4/identical-links-same-purpose?application=RuleDescription) | Ensure that links with the same accessible name serve a similar purpose | Minor | cat.semantics, wcag2aaa, wcag249 | needs review | [b20e66](https://act-rules.github.io/rules/b20e66) | +| [meta-refresh-no-exceptions](https://dequeuniversity.com/rules/axe/4.4/meta-refresh-no-exceptions?application=RuleDescription) | Ensures <meta http-equiv="refresh"> is not used for delayed refresh | Minor | cat.time-and-media, wcag2aaa, wcag224, wcag325 | failure | [bisz58](https://act-rules.github.io/rules/bisz58) | ## Experimental Rules diff --git a/lib/checks/navigation/meta-refresh-no-exceptions.json b/lib/checks/navigation/meta-refresh-no-exceptions.json new file mode 100644 index 0000000000..b3411b9f60 --- /dev/null +++ b/lib/checks/navigation/meta-refresh-no-exceptions.json @@ -0,0 +1,15 @@ +{ + "id": "meta-refresh-no-exceptions", + "evaluate": "meta-refresh-evaluate", + "options": { + "minDelay": 0, + "maxDelay": false + }, + "metadata": { + "impact": "minor", + "messages": { + "pass": " tag does not immediately refresh the page", + "fail": " tag forces timed refresh of page" + } + } +} diff --git a/lib/checks/navigation/meta-refresh.json b/lib/checks/navigation/meta-refresh.json index 7c85c6d5d0..a37cb89a79 100644 --- a/lib/checks/navigation/meta-refresh.json +++ b/lib/checks/navigation/meta-refresh.json @@ -9,7 +9,7 @@ "impact": "critical", "messages": { "pass": " tag does not immediately refresh the page", - "fail": " tag forces timed refresh of page" + "fail": " tag forces timed refresh of page (less than 20 hours)" } } } diff --git a/lib/rules/meta-refresh-no-exceptions.json b/lib/rules/meta-refresh-no-exceptions.json new file mode 100644 index 0000000000..e1d3e819c5 --- /dev/null +++ b/lib/rules/meta-refresh-no-exceptions.json @@ -0,0 +1,20 @@ +{ + "id": "meta-refresh-no-exceptions", + "selector": "meta[http-equiv=\"refresh\"][content]", + "excludeHidden": false, + "enabled": false, + "tags": [ + "cat.time-and-media", + "wcag2aaa", + "wcag224", + "wcag325" + ], + "actIds": ["bisz58"], + "metadata": { + "description": "Ensures is not used for delayed refresh", + "help": "Delayed refresh must not be used" + }, + "all": [], + "any": ["meta-refresh-no-exceptions"], + "none": [] +} diff --git a/lib/rules/meta-refresh.json b/lib/rules/meta-refresh.json index 32fa2cc129..f56e8f87ed 100644 --- a/lib/rules/meta-refresh.json +++ b/lib/rules/meta-refresh.json @@ -11,8 +11,8 @@ ], "actIds": ["bc659a"], "metadata": { - "description": "Ensures is not used", - "help": "Timed refresh must not exist" + "description": "Ensures is not used for delayed refresh", + "help": "Delayed refresh under 20 hours must not be used" }, "all": [], "any": ["meta-refresh"], diff --git a/test/integration/full/meta-refresh-no-exceptions/meta-refresh-fail.js b/test/integration/full/meta-refresh-no-exceptions/meta-refresh-fail.js new file mode 100644 index 0000000000..cedec6dc20 --- /dev/null +++ b/test/integration/full/meta-refresh-no-exceptions/meta-refresh-fail.js @@ -0,0 +1,18 @@ +describe('meta-refresh-no-exceptions fail', function() { + 'use strict'; + + it('should be a violation', function(done) { + axe.run({ runOnly: 'meta-refresh-no-exceptions' }, function(err, results) { + try { + assert.isNull(err); + assert.lengthOf(results.violations, 1, 'violations'); + assert.lengthOf(results.passes, 0, 'passes'); + assert.lengthOf(results.incomplete, 0, 'passes'); + assert.lengthOf(results.inapplicable, 0, 'inapplicable'); + done(); + } catch (e) { + done(e); + } + }); + }); +}); diff --git a/test/integration/full/meta-refresh-no-exceptions/meta-refresh-fail1.html b/test/integration/full/meta-refresh-no-exceptions/meta-refresh-fail1.html new file mode 100644 index 0000000000..b5c740efa2 --- /dev/null +++ b/test/integration/full/meta-refresh-no-exceptions/meta-refresh-fail1.html @@ -0,0 +1,28 @@ + + +
+ +