edx-custom-a11y-rules
Advanced tools
Comparing version
@@ -58,5 +58,5 @@ var customRules = { | ||
'metadata': { | ||
'description': 'Ensures the first link on the page is a skip link', | ||
'help': 'The page should have a skip link as its first link', | ||
'helpUrl': 'https://dequeuniversity.com/rules/axe/1.1/skip-link' | ||
'description': 'Ensures that all skip links have a valid target', | ||
'help': 'All skip links should have a valid target, allowing users to skip the navigation', | ||
'helpUrl': 'https://dequeuniversity.com/rules/axe/3.2/skip-link' | ||
} | ||
@@ -121,2 +121,3 @@ }, | ||
evaluate: function(node, options) { | ||
axe._tree = axe.utils.getFlattenedTree(node); | ||
return axe.commons.aria.label(node) !== null; | ||
@@ -137,2 +138,3 @@ } | ||
evaluate: function(node, options) { | ||
axe._tree = axe.utils.getFlattenedTree(node); | ||
var label = axe.commons.aria.label(node) || '', | ||
@@ -176,2 +178,5 @@ words = label.toLowerCase().split(' '); | ||
linkTarget = document.querySelector(href); | ||
if (!linkTarget) { | ||
return false; | ||
} | ||
return axe.commons.dom.isFocusable(linkTarget); | ||
@@ -178,0 +183,0 @@ } else { |
{ | ||
"name": "edx-custom-a11y-rules", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Custom rules for accessibility testing with aXe Core", | ||
@@ -26,3 +26,3 @@ "main": "", | ||
"devDependencies": { | ||
"axe-core": "~1.1.0", | ||
"axe-core": "~3.2.2", | ||
"jasmine-core": "^2.3.4", | ||
@@ -29,0 +29,0 @@ "jshint": "^2.8.0", |
35482
0.71%238
2.15%