From 4c10fc2bc8182f60203a03c3d13bf5877e416b70 Mon Sep 17 00:00:00 2001 From: ironikart Date: Tue, 20 Jun 2017 08:48:04 +1000 Subject: [PATCH] Additional fix for #160 allowing hyperlinks with labels to be considered as having valid content. --- Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_2.js | 6 ++++-- Tests/WCAG2/4_1_2_Aria_Labels.html | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_2.js b/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_2.js index d3d611e8..7b998f93 100755 --- a/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_2.js +++ b/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_2.js @@ -136,11 +136,13 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle4_Guideline4_1_4_1_2 = { }//end if } else { if (nameFound === false) { - // Href provided, but no content or title. + // Href provided, but no content, title or valid aria label. // We only fire this message when there are no images in the content. // A link around an image with no alt text is already covered in SC // 1.1.1 (test H30). - if (element.querySelectorAll('img').length === 0) { + if (element.querySelectorAll('img').length === 0 + && HTMLCS.util.hasValidAriaLabel(element) === false + ) { errors.noContent.push(element); } }//end if diff --git a/Tests/WCAG2/4_1_2_Aria_Labels.html b/Tests/WCAG2/4_1_2_Aria_Labels.html index 0c202b56..5e7eeea4 100644 --- a/Tests/WCAG2/4_1_2_Aria_Labels.html +++ b/Tests/WCAG2/4_1_2_Aria_Labels.html @@ -12,6 +12,7 @@ Assert: Error *.H53.ARIA6 on #objectNoLabel Assert: No Error *.H53.ARIA6 on #objectLabelledBy Assert: No Error *.H53.ARIA6 on #objectLabel +Assert: No Error *.H91.A.NoContent on #hyperlinkLabel --> @@ -42,6 +43,8 @@ + +