Socket
Socket
Sign inDemoInstall

html_codesniffer

Package Overview
Dependencies
Maintainers
13
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html_codesniffer - npm Package Compare versions

Comparing version 2.4.1 to 2.5.0

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_4.js

55

HTMLCS.Util.js

@@ -1315,3 +1315,58 @@ /**

/**
* Get the text content of a DOM node.
*
* @param {DOMNode} element Element to process.
*
* @returns {String} The text content.
*/
self.getTextContent = function(element) {
if (element.textContent !== undefined) {
return element.textContent;
} else {
return element.innerText;
}
};
/**
* Get the accessible name.
*
* @param {DOMNode} element Element to process.
* @param {DOMNode} top Scoped container element.
*
* @returns {String} The accessible name.
*/
self.getAccessibleName = function(element, top) {
// See https://www.w3.org/TR/accname-1.1/#terminology
if (self.isVisuallyHidden(element)) {
return '';
}
else if (element.getAttribute("aria-labelledby")) {
var nameParts = [];
var parts = element.getAttribute("aria-labelledby").split(" ");
for (var i = 0; i < parts.length; i++) {
var x = parts[i];
var nameElement = top.getElementById(x);
if (nameElement) {
nameParts.push(nameElement.textContent);
}
}
return nameParts.join(" ");
} else if (element.getAttribute("aria-label")) {
return element.getAttribute("aria-label");
} else if (element.getAttribute("title")) {
if (
element.getAttribute("role") !== "presentation" &&
element.getAttribute("role") !== "none"
) {
return element.getAttribute("aria-label");
}
}
// Give up - we only test the 3 most obvious cases.
return "";
};
return self;
}();

10

package.json
{
"name": "html_codesniffer",
"version": "2.4.1",
"version": "2.5.0",
"description": "HTML_CodeSniffer is a client-side JavaScript that checks a HTML document or source code, and detects violations of a defined coding standard.",

@@ -38,9 +38,9 @@ "license": "BSD-3-Clause",

"devDependencies": {
"grunt": "^1.0.3",
"grunt": "^1.1.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-uglify": "^4.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-eslint": "^21.0.0",
"grunt-contrib-watch": "^1.1.0",
"load-grunt-tasks": "^4.0.0",
"grunt-contrib-uglify": "^4.0.0"
"load-grunt-tasks": "^4.0.0"
}
}

@@ -51,3 +51,3 @@ /**

// audio is not considered "multimedia" (roughly equivalent to a
// "synchronised media" presentation in WCAG 2.0). It is non-text,
// "synchronised media" presentation in WCAG 2.1). It is non-text,
// though, so a transcript is required.

@@ -181,3 +181,3 @@ HTMLCS.addMessage(HTMLCS.NOTICE, element, 'For multimedia containing audio only, ensure an alternative is available, such as a full text transcript.', 'Audio');

* This takes the generic result given by the alt text testing functions
* (located in WCAG 2.0 SC 1.1.1), and converts them into Section 508-specific
* (located in WCAG 2.1 SC 1.1.1), and converts them into Section 508-specific
* messages.

@@ -298,3 +298,3 @@ *

* This takes the generic result given by the media alternative testing function
* (located in WCAG 2.0 SC 1.1.1), and converts them into Section
* (located in WCAG 2.1 SC 1.1.1), and converts them into Section
* 508-specific messages.

@@ -301,0 +301,0 @@ *

@@ -16,3 +16,3 @@ /**

name: 'WCAG2A',
description: 'Web Content Accessibility Guidelines (WCAG) 2.0 A',
description: 'Web Content Accessibility Guidelines (WCAG) 2.1 A',
sniffs: [

@@ -34,2 +34,3 @@ {

'Principle2.Guideline2_1.2_1_2',
'Principle2.Guideline2_1.2_1_4',
'Principle2.Guideline2_2.2_2_1',

@@ -42,2 +43,6 @@ 'Principle2.Guideline2_2.2_2_2',

'Principle2.Guideline2_4.2_4_4',
'Principle2.Guideline2_5.2_5_1',
'Principle2.Guideline2_5.2_5_2',
'Principle2.Guideline2_5.2_5_3',
'Principle2.Guideline2_5.2_5_4',
'Principle3.Guideline3_1.3_1_1',

@@ -44,0 +49,0 @@ 'Principle3.Guideline3_2.3_2_1',

@@ -16,3 +16,3 @@ /**

name: 'WCAG2AA',
description: 'Web Content Accessibility Guidelines (WCAG) 2.0 AA',
description: 'Web Content Accessibility Guidelines (WCAG) 2.1 AA',
sniffs: [

@@ -31,2 +31,4 @@ {

'Principle1.Guideline1_3.1_3_3',
'Principle1.Guideline1_3.1_3_4',
'Principle1.Guideline1_3.1_3_5',
'Principle1.Guideline1_4.1_4_1',

@@ -39,4 +41,9 @@ 'Principle1.Guideline1_4.1_4_2',

'Principle1.Guideline1_4.1_4_5',
'Principle1.Guideline1_4.1_4_10',
'Principle1.Guideline1_4.1_4_11',
'Principle1.Guideline1_4.1_4_12',
'Principle1.Guideline1_4.1_4_13',
'Principle2.Guideline2_1.2_1_1',
'Principle2.Guideline2_1.2_1_2',
'Principle2.Guideline2_1.2_1_4',
'Principle2.Guideline2_2.2_2_1',

@@ -52,2 +59,6 @@ 'Principle2.Guideline2_2.2_2_2',

'Principle2.Guideline2_4.2_4_7',
'Principle2.Guideline2_5.2_5_1',
'Principle2.Guideline2_5.2_5_2',
'Principle2.Guideline2_5.2_5_3',
'Principle2.Guideline2_5.2_5_4',
'Principle3.Guideline3_1.3_1_1',

@@ -64,3 +75,4 @@ 'Principle3.Guideline3_1.3_1_2',

'Principle4.Guideline4_1.4_1_1',
'Principle4.Guideline4_1.4_1_2'
'Principle4.Guideline4_1.4_1_2',
'Principle4.Guideline4_1.4_1_3'
]

@@ -67,0 +79,0 @@ }

@@ -16,3 +16,3 @@ /**

name: 'WCAG2AAA',
description: 'Web Content Accessibility Guidelines (WCAG) 2.0 AAA',
description: 'Web Content Accessibility Guidelines (WCAG) 2.1 AAA',
sniffs: [

@@ -32,2 +32,5 @@ 'Principle1.Guideline1_1.1_1_1',

'Principle1.Guideline1_3.1_3_3',
'Principle1.Guideline1_3.1_3_4',
'Principle1.Guideline1_3.1_3_5',
'Principle1.Guideline1_3.1_3_6',
'Principle1.Guideline1_4.1_4_1',

@@ -41,4 +44,9 @@ 'Principle1.Guideline1_4.1_4_2',

'Principle1.Guideline1_4.1_4_9',
'Principle1.Guideline1_4.1_4_10',
'Principle1.Guideline1_4.1_4_11',
'Principle1.Guideline1_4.1_4_12',
'Principle1.Guideline1_4.1_4_13',
'Principle2.Guideline2_1.2_1_1',
'Principle2.Guideline2_1.2_1_2',
'Principle2.Guideline2_1.2_1_4',
'Principle2.Guideline2_2.2_2_2',

@@ -48,3 +56,5 @@ 'Principle2.Guideline2_2.2_2_3',

'Principle2.Guideline2_2.2_2_5',
'Principle2.Guideline2_2.2_2_6',
'Principle2.Guideline2_3.2_3_2',
'Principle2.Guideline2_3.2_3_3',
'Principle2.Guideline2_4.2_4_1',

@@ -58,2 +68,8 @@ 'Principle2.Guideline2_4.2_4_2',

'Principle2.Guideline2_4.2_4_9',
'Principle2.Guideline2_5.2_5_1',
'Principle2.Guideline2_5.2_5_2',
'Principle2.Guideline2_5.2_5_3',
'Principle2.Guideline2_5.2_5_4',
'Principle2.Guideline2_5.2_5_5',
'Principle2.Guideline2_5.2_5_6',
'Principle3.Guideline3_1.3_1_1',

@@ -76,3 +92,4 @@ 'Principle3.Guideline3_1.3_1_2',

'Principle4.Guideline4_1.4_1_1',
'Principle4.Guideline4_1.4_1_2'
'Principle4.Guideline4_1.4_1_2',
'Principle4.Guideline4_1.4_1_3'
],

@@ -83,15 +100,15 @@ getMsgInfo: function(code) {

name: 'Perceivable',
link: 'http://www.w3.org/TR/WCAG20/#perceivable'
link: 'http://www.w3.org/TR/WCAG21/#perceivable'
},
'Principle2': {
name: 'Operable',
link: 'http://www.w3.org/TR/WCAG20/#operable'
link: 'http://www.w3.org/TR/WCAG21/#operable'
},
'Principle3': {
name: 'Understandable',
link: 'http://www.w3.org/TR/WCAG20/#understandable'
link: 'http://www.w3.org/TR/WCAG21/#understandable'
},
'Principle4': {
name: 'Robust',
link: 'http://www.w3.org/TR/WCAG20/#robust'
link: 'http://www.w3.org/TR/WCAG21/#robust'
}

@@ -101,3 +118,3 @@ };

/**
* List of success criteria, their links in the WCAG20 doc, and their
* List of success criteria, their links in the WCAG21 doc, and their
* "priority" (to use a WCAG1 term)... priority 1 = single-A, 3 = triple-A.

@@ -131,3 +148,3 @@ *

name: 'Non-Text Content',
landmark: 'text-equiv-all',
landmark: 'non-text-content',
priority: 1,

@@ -137,3 +154,3 @@ },

name: 'Audio-only and Video-only (Prerecorded)',
landmark: 'media-equiv-av-only-alt',
landmark: 'audio-only-and-video-only-prerecorded',
priority: 1,

@@ -143,3 +160,3 @@ },

name: 'Captions (Prerecorded)',
landmark: 'media-equiv-captions',
landmark: 'captions-prerecorded',
priority: 1,

@@ -149,3 +166,3 @@ },

name: 'Audio Description or Media Alternative (Prerecorded)',
landmark: 'media-equiv-audio-desc',
landmark: 'audio-description-or-media-alternative-prerecorded',
priority: 1,

@@ -155,3 +172,3 @@ },

name: 'Captions (Live)',
landmark: 'media-equiv-captions',
landmark: 'captions-live',
priority: 2,

@@ -161,3 +178,3 @@ },

name: 'Audio Description (Prerecorded)',
landmark: 'media-equiv-audio-desc',
landmark: 'audio-description-prerecorded',
priority: 2,

@@ -167,3 +184,3 @@ },

name: 'Sign Language (Prerecorded)',
landmark: 'media-equiv-sign',
landmark: 'sign-language-prerecorded',
priority: 3,

@@ -173,3 +190,3 @@ },

name: 'Extended Audio Description (Prerecorded)',
landmark: 'media-equiv-extended-ad',
landmark: 'extended-audio-description-prerecorded',
priority: 3,

@@ -179,3 +196,3 @@ },

name: 'Media Alternative (Prerecorded)',
landmark: 'media-equiv-text-doc',
landmark: 'media-alternative-prerecorded',
priority: 3,

@@ -185,3 +202,3 @@ },

name: 'Audio-only (Live)',
landmark: 'media-equiv-live-audio-only',
landmark: 'audio-only-live',
priority: 3,

@@ -191,3 +208,3 @@ },

name: 'Info and Relationships',
landmark: 'content-structure-separation-programmatic',
landmark: 'info-and-relationships',
priority: 1,

@@ -197,3 +214,3 @@ },

name: 'Meaningful Sequence',
landmark: 'content-structure-separation-sequence',
landmark: 'meaningful-sequence',
priority: 1,

@@ -203,8 +220,23 @@ },

name: 'Sensory Characteristics',
landmark: 'content-structure-separation-understanding',
landmark: 'sensory-characteristics',
priority: 1,
},
'1.3.4': {
name: 'Orientation',
landmark: 'orientation',
priority: 2,
},
'1.3.5': {
name: 'Identify Input Purpose',
landmark: 'identify-input-purpose',
priority: 2,
},
'1.3.6': {
name: 'Identify Purpose',
landmark: 'identify-purpose',
priority: 3,
},
'1.4.1': {
name: 'Use of Colour',
landmark: 'visual-audio-contrast-without-color',
landmark: 'use-of-color',
priority: 1,

@@ -214,3 +246,3 @@ },

name: 'Audio Control',
landmark: 'visual-audio-contrast-dis-audio',
landmark: 'audio-control',
priority: 1,

@@ -220,3 +252,3 @@ },

name: 'Contrast (Minimum)',
landmark: 'visual-audio-contrast-contrast',
landmark: 'contrast-minimum',
priority: 1,

@@ -226,3 +258,3 @@ },

name: 'Resize Text',
landmark: 'visual-audio-contrast-scale',
landmark: 'resize-text',
priority: 1,

@@ -232,3 +264,3 @@ },

name: 'Images of Text',
landmark: 'visual-audio-contrast-text-presentation',
landmark: 'images-of-text',
priority: 1,

@@ -238,3 +270,3 @@ },

name: 'Contrast (Enhanced)',
landmark: 'visual-audio-contrast7',
landmark: 'contrast-enhanced',
priority: 3,

@@ -244,3 +276,3 @@ },

name: 'Low or No Background Audio',
landmark: 'visual-audio-contrast-noaudio',
landmark: 'low-or-no-background-audio',
priority: 3,

@@ -250,3 +282,3 @@ },

name: 'Visual Presentation',
landmark: 'visual-audio-contrast-visual-presentation',
landmark: 'visual--presentation',
priority: 3,

@@ -256,8 +288,28 @@ },

name: 'Images of Text (No Exception)',
landmark: 'visual-audio-contrast-text-images',
landmark: 'images-of-text-no-exception',
priority: 3,
},
'1.4.10': {
name: 'Reflow',
landmark: 'reflow',
priority: 2,
},
'1.4.11': {
name: 'Non-text Contrast',
landmark: 'non-text-contrast',
priority: 2,
},
'1.4.12': {
name: 'Text Spacing',
landmark: 'text-spacing',
priority: 2,
},
'1.4.13': {
name: 'Content on Hover or Focus',
landmark: 'content-on-hover-or-focus',
priority: 2,
},
'2.1.1': {
name: 'Keyboard',
landmark: 'keyboard-operation-keyboard-operable',
landmark: 'keyboard',
priority: 1,

@@ -267,3 +319,3 @@ },

name: 'No Keyboard Trap',
landmark: 'keyboard-operation-trapping',
landmark: 'no-keyboard-trap',
priority: 1,

@@ -273,8 +325,13 @@ },

name: 'Keyboard (No Exception)',
landmark: 'keyboard-operation-all-funcs',
landmark: 'keyboard-no-exception',
priority: 3,
},
'2.1.4': {
name: 'Character Key Shortcuts',
landmark: 'character-key-shortcuts',
priority: 1,
},
'2.2.1': {
name: 'Timing Adjustable',
landmark: 'time-limits-required-behaviors',
landmark: 'timing-adjustable',
priority: 1,

@@ -284,3 +341,3 @@ },

name: 'Pause, Stop, Hide',
landmark: 'time-limits-pause',
landmark: 'pause-stop-hide',
priority: 1,

@@ -290,3 +347,3 @@ },

name: 'No Timing',
landmark: 'time-limits-no-exceptions',
landmark: 'no-timing',
priority: 3,

@@ -296,3 +353,3 @@ },

name: 'Interruptions',
landmark: 'time-limits-postponed',
landmark: 'interruptions',
priority: 3,

@@ -302,8 +359,13 @@ },

name: 'Re-authenticating',
landmark: 'time-limits-server-timeout',
landmark: 're-authenticating',
priority: 3,
},
'2.2.6': {
name: 'Timeouts',
landmark: 'timeouts',
priority: 3,
},
'2.3.1': {
name: 'Three Flashes or Below Threshold',
landmark: 'seizure-does-not-violate',
landmark: 'three-flashes-or-below-threshold',
priority: 1,

@@ -313,8 +375,13 @@ },

name: 'Three Flashes',
landmark: 'seizure-three-times',
landmark: 'three-flashes',
priority: 3,
},
'2.3.3': {
name: 'Animation from Interactions',
landmark: 'animation-from-interactions',
priority: 3,
},
'2.4.1': {
name: 'Bypass Blocks',
landmark: 'navigation-mechanisms-skip',
landmark: 'bypass-blocks',
priority: 1,

@@ -324,3 +391,3 @@ },

name: 'Page Titled',
landmark: 'navigation-mechanisms-title',
landmark: 'page-titled',
priority: 1,

@@ -330,3 +397,3 @@ },

name: 'Focus Order',
landmark: 'navigation-mechanisms-focus-order',
landmark: 'focus-order',
priority: 1,

@@ -336,3 +403,3 @@ },

name: 'Link Purpose (In Context)',
landmark: 'navigation-mechanisms-refs',
landmark: 'link-purpose-in-context',
priority: 1,

@@ -342,3 +409,3 @@ },

name: 'Multiple Ways',
landmark: 'navigation-mechanisms-mult-loc',
landmark: 'multiple-ways',
priority: 2,

@@ -348,3 +415,3 @@ },

name: 'Headings and Labels',
landmark: 'navigation-mechanisms-descriptive',
landmark: 'headings-and-labels',
priority: 2,

@@ -354,3 +421,3 @@ },

name: 'Focus Visible',
landmark: 'navigation-mechanisms-focus-visible',
landmark: 'focus-visible',
priority: 2,

@@ -360,3 +427,3 @@ },

name: 'Location',
landmark: 'navigation-mechanisms-location',
landmark: 'location',
priority: 3,

@@ -366,3 +433,3 @@ },

name: 'Link Purpose (Link Only)',
landmark: 'navigation-mechanisms-link',
landmark: 'link-purpose-link-only',
priority: 3,

@@ -372,8 +439,38 @@ },

name: 'Section Headings',
landmark: 'navigation-mechanisms-headings',
landmark: 'section-headings',
priority: 3,
},
'2.5.1': {
name: 'Pointer Gestures',
landmark: 'pointer-gestures',
priority: 1,
},
'2.5.2': {
name: 'Pointer Cancellation',
landmark: 'pointer-cancellation',
priority: 1,
},
'2.5.3': {
name: 'Label In Name',
landmark: 'label-in-name',
priority: 1,
},
'2.5.4': {
name: 'Motion Actuation',
landmark: 'motion-actuation',
priority: 1,
},
'2.5.5': {
name: 'Target Size',
landmark: 'target-size',
priority: 3,
},
'2.5.6': {
name: 'Concurrent Input Mechanisms',
landmark: 'concurrent-input-mechanisms',
priority: 3,
},
'3.1.1': {
name: 'Language of Page',
landmark: 'meaning-doc-lang-id',
landmark: 'language-of-page',
priority: 1,

@@ -383,3 +480,3 @@ },

name: 'Language of Parts',
landmark: 'meaning-other-lang-id',
landmark: 'language-of-parts',
priority: 2,

@@ -389,3 +486,3 @@ },

name: 'Unusual Words',
landmark: 'meaning-idioms',
landmark: 'unusual-words',
priority: 3,

@@ -395,3 +492,3 @@ },

name: 'Abbreviations',
landmark: 'meaning-located',
landmark: 'abbreviations',
priority: 3,

@@ -401,3 +498,3 @@ },

name: 'Reading Level',
landmark: 'meaning-supplements',
landmark: 'reading-level',
priority: 3,

@@ -407,3 +504,3 @@ },

name: 'Pronunciation',
landmark: 'meaning-pronunciation',
landmark: 'pronunciation',
priority: 3,

@@ -413,3 +510,3 @@ },

name: 'On Focus',
landmark: 'consistent-behavior-receive-focus',
landmark: 'on-focus',
priority: 1,

@@ -419,3 +516,3 @@ },

name: 'On Input',
landmark: 'consistent-behavior-unpredictable-change',
landmark: 'on-input',
priority: 1,

@@ -425,8 +522,8 @@ },

name: 'Consistent Navigation',
landmark: 'consistent-behavior-consistent-locations',
landmark: 'consistent-navigation',
priority: 2,
},
'3.2.4': {
name: 'Consistent Navigation',
landmark: 'consistent-behavior-consistent-functionality',
name: 'Consistent Identification',
landmark: 'consistent-identification',
priority: 2,

@@ -436,3 +533,3 @@ },

name: 'Change on Request',
landmark: 'consistent-behavior-no-extreme-changes-context',
landmark: 'change-on-request',
priority: 3,

@@ -442,3 +539,3 @@ },

name: 'Error Identification',
landmark: 'minimize-error-identified',
landmark: 'error-identification',
priority: 1,

@@ -448,3 +545,3 @@ },

name: 'Labels or Instructions',
landmark: 'minimize-error-cues',
landmark: 'labels-or-instructions',
priority: 1,

@@ -454,3 +551,3 @@ },

name: 'Error Suggestion',
landmark: 'minimize-error-suggestions',
landmark: 'error-suggestion',
priority: 2,

@@ -460,3 +557,3 @@ },

name: 'Error Prevention (Legal, Financial, Data)',
landmark: 'minimize-error-reversible',
landmark: 'error-prevention-legal-financial-data',
priority: 2,

@@ -466,3 +563,3 @@ },

name: 'Help',
landmark: 'minimize-error-context-help',
landmark: 'help',
priority: 3,

@@ -472,3 +569,3 @@ },

name: 'Error Prevention (All)',
landmark: 'minimize-error-reversible-all',
landmark: 'error-prevention-all',
priority: 3,

@@ -478,3 +575,3 @@ },

name: 'Parsing',
landmark: 'ensure-compat-parses',
landmark: 'parsing',
priority: 1,

@@ -484,5 +581,10 @@ },

name: 'Name, Role, Value',
landmark: 'ensure-compat-rsv',
landmark: 'name-role-value',
priority: 1,
},
'4.1.3': {
name: 'Status Messages',
landmark: 'status-messages',
priority: 2,
},
};

@@ -495,9 +597,56 @@

var techniquesStr = [];
function getPrefix(x) {
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
function startsWith(str, search, rawPos) {
var pos = rawPos > 0 ? rawPos|0 : 0;
return str.substring(pos, pos + search.length) === search;
}
if (startsWith(x, 'ARIA')) {
return 'aria/';
}
if (startsWith(x, 'SCR')) {
return 'client-side-script/';
}
if (startsWith(x, 'C')) {
return 'css/';
}
if (startsWith(x, 'FLASH')) {
return 'flash/';
}
if (startsWith(x, 'F')) {
return 'failures/';
}
if (startsWith(x, 'G')) {
return 'general/';
}
if (startsWith(x, 'H')) {
return 'html/';
}
if (startsWith(x, 'PDF')) {
return 'pdf/';
}
if (startsWith(x, 'SVR')) {
return 'server-side-script/';
}
if (startsWith(x, 'SL')) {
return 'silverlight/';
}
if (startsWith(x, 'SM')) {
return 'smil/';
}
if (startsWith(x, 'T')) {
return 'text/';
}
return '';
}
for (var i = 0; i < techniques.length; i++) {
techniques[i] = techniques[i].split('.');
techniquesStr.push('<a href="http://www.w3.org/TR/WCAG20-TECHS/' + techniques[i][0] + '" target="_blank">' + techniques[i][0] + '</a>');
if (techniques[i][0] !== '') {
techniquesStr.push('<a href="https://www.w3.org/WAI/WCAG21/Techniques/' + getPrefix(techniques[i][0]) + techniques[i][0] + '" target="_blank">' + techniques[i][0] + '</a>');
}
}
var successCritStr = ['<a href="http://www.w3.org/TR/WCAG20/#' + successCritList[successCrit].landmark, '" target="_blank">', successCrit, ': ', successCritList[successCrit].name, '</a>'].join('');
var successCritStr = ['<a href="http://www.w3.org/TR/WCAG21/#' + successCritList[successCrit].landmark, '" target="_blank">', successCrit, ': ', successCritList[successCrit].name, '</a>'].join('');
/* eslint-disable-next-line no-unused-vars */

@@ -507,4 +656,6 @@ var principleStr = ['<a href="', principles[principle].link, '" target="_blank">', principles[principle].name, '</a>'].join('');

[_global.HTMLCS.getTranslation("auditor_success_criterion"), successCritStr],
[_global.HTMLCS.getTranslation("auditor_suggested_techniques"), techniquesStr.join(' ')]
];
if (techniquesStr.length > 0) {
retval.push([_global.HTMLCS.getTranslation("auditor_suggested_techniques"), techniquesStr.join(' ')]);
}

@@ -511,0 +662,0 @@ return retval;

@@ -59,3 +59,3 @@ /**

* This takes the generic result given by the alt text testing functions,
* and converts them into WCAG 2.0-specific messages.
* and converts them into WCAG 2.1-specific messages.
*

@@ -341,3 +341,3 @@ * @param {DOMNode} element The element to test.

* This takes the generic result given by the media alternative testing function,
* and converts them into WCAG 2.0-specific messages.
* and converts them into WCAG 2.1-specific messages.
*

@@ -344,0 +344,0 @@ * @param {DOMNode} element The element to test.

@@ -106,7 +106,8 @@ /**

{
var permitted = ['div', 'span', 'b', 'i'];
if (HTMLCS.util.isAriaHidden(element) === false
&& element.hasAttribute('role')
&& element.getAttribute('role') === 'presentation'
&& element.getAttribute('role') === 'presentation'
&& permitted.indexOf(element.nodeName.toLowerCase()) === -1
) {
var permitted = ['div', 'span', 'b', 'i'];
var children = element.querySelectorAll('*:not('+permitted.join('):not(')+')');

@@ -113,0 +114,0 @@ children = [].filter.call(children, function(child) {

@@ -113,3 +113,3 @@ /**

{
if (element.hasAttribute('href') === true) {
if (element.hasAttribute('href') === true && HTMLCS.util.isFocusable(element) === true) {
var href = element.getAttribute('href');

@@ -116,0 +116,0 @@ href = HTMLCS.util.trim(href);

@@ -40,2 +40,3 @@ _global.translation['en'] = {

//1_1_1.js

@@ -106,3 +107,3 @@ ,"1_1_1_H30.2" : 'Img element is the only content of the link, but is missing alt text. The alt text should describe the purpose of the link.'

,"1_3_1_ARIA6" : 'This form control has an "aria-label" attribute that is empty or contains only spaces. It will be ignored for labelling test purposes.'
//{{id}} will be replace with element ID:
//{{id}} will be replaced with element ID:
,"1_3_1_ARIA16,ARIA9" : 'This form control contains an aria-labelledby attribute, however it includes an ID "{{id}}" that does not exist on an element. The aria-labelledby attribute will be ignored for labelling test purposes.'

@@ -166,2 +167,24 @@

//1_3_4.js
,"1_3_4.RestrictView" : 'Check that content does not restrict its view and operation to a single display orientation, such as portrait or landscape, unless a specific display orientation is essential.'
//1_3_5.js
,"1_3_5_H98.FaultyValue" : 'This element contains a potentially faulty value in its autocomplete attribute: {{valuesStr}}.'
,"1_3_5_H98.InvalidAutocomplete_Text" : 'Invalid autocomplete value: {{x}}. Element does not belong to Text control group.'
,"1_3_5_H98.InvalidAutocomplete_Multiline" : 'Invalid autocomplete value: {{x}}. Element does not belong to Multiline control group.'
,"1_3_5_H98.InvalidAutocomplete_Password" : 'Invalid autocomplete value: {{x}}. Element does not belong to Password control group.'
,"1_3_5_H98.InvalidAutocomplete_Url" : 'Invalid autocomplete value: {{x}}. Element does not belong to Url control group.'
,"1_3_5_H98.InvalidAutocomplete_Telephone" : 'Invalid autocomplete value: {{x}}. Element does not belong to Telephone control group.'
,"1_3_5_H98.InvalidAutocomplete_Numeric" : 'Invalid autocomplete value: {{x}}. Element does not belong to Numeric control group.'
,"1_3_5_H98.InvalidAutocomplete_Month" : 'Invalid autocomplete value: {{x}}. Element does not belong to Month control group.'
,"1_3_5_H98.InvalidAutocomplete_Date" : 'Invalid autocomplete value: {{x}}. Element does not belong to Date control group.'
,"1_3_5_H98.Purpose" : 'Check that the input field serves a purpose identified in the Input Purposes for User Interface Components section; and that the content is implemented using technologies with support for identifying the expected meaning for form input data.'
,"1_3_5_H98.MissingAutocomplete" : 'This element does not have an autocomplete attribute. If this field collects information about the user, consider adding one to comply with this Success Criterion.'
//1_3_6.js
,"1_3_6_ARIA11.Check" : 'Check that the purpose of User Interface Components, icons, and regions can be programmatically determined.'
//1_4_1.js

@@ -207,3 +230,2 @@ ,"1_4_1_G14,G18" : 'Check that any information conveyed using colour alone is also available in text, or through other visual cues.'

//1_4_7.js

@@ -225,2 +247,34 @@ ,"1_4_7_G56" : 'For pre-recorded audio-only content in this element that is primarily speech (such as narration), any background sounds should be muteable, or be at least 20 dB (or about 4 times) quieter than the speech.'

//1_4_10.js
,"1_4_10_C32,C31,C33,C38,SCR34,G206.Check" : "Check that content can be presented without loss of information or functionality, and without requiring scrolling in two dimensions for: \
Vertical scrolling content at a width equivalent to 320 CSS pixels; \
Horizontal scrolling content at a height equivalent to 256 CSS pixels; \
Except for parts of the content which require two-dimensional layout for usage or meaning."
,"1_4_10_C32,C31,C33,C38,SCR34,G206.Fixed" : 'This element has "position: fixed". This may require scrolling in two dimensions, which is considered a failure of this Success Criterion.'
,"1_4_10_C32,C31,C33,C38,SCR34,G206.Scrolling" : 'Preformatted text may require scrolling in two dimensions, which is considered a failure of this Success Criterion.'
,"1_4_10_C32,C31,C33,C38,SCR34,G206.Zoom" : "Interfering with a user agent's ability to zoom may be a failure of this Success Criterion."
//1_4_11.js
,"1_4_11_G195,G207,G18,G145,G174,F78.Check" : 'Check that the visual presentation of the following have a contrast ratio of at least 3:1 against adjacent color(s): \
User Interface Components: Visual information required to identify user interface components and states, except for inactive components or where the appearance of the component is determined by the user agent and not modified by the author; \
Graphical Objects: Parts of graphics required to understand the content, except when a particular presentation of graphics is essential to the information being conveyed.'
//1_4_12.js
,"1_4_12_C36,C35.Check" : 'Check that no loss of content or functionality occurs by setting all of the following and by changing no other style property: \
\
Line height (line spacing) to at least 1.5 times the font size; \
Spacing following paragraphs to at least 2 times the font size; \
Letter spacing (tracking) to at least 0.12 times the font size; \
Word spacing to at least 0.16 times the font size.'
//1_4_13.js
,"1_4_13_F95.Check" : 'Check that where receiving and then removing pointer hover or keyboard focus triggers additional content to become visible and then hidden, the following are true: \
\
Dismissable: A mechanism is available to dismiss the additional content without moving pointer hover or keyboard focus, unless the additional content communicates an input error or does not obscure or replace other content; \
Hoverable: If pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing; \
Persistent: The additional content remains visible until the hover or focus trigger is removed, the user dismisses it, or its information is no longer valid.'
//2_1_1.js

@@ -240,2 +294,11 @@ ,"2_1_1_G90" : 'Ensure the functionality provided by an event handler for this element is available through the keyboard'

//2_1_4.js
,"2_1_4.Check" : 'Check that if a keyboard shortcut is implemented in content using only letter (including upper- and lower-case letters), punctuation, number, or symbol characters, then at least one of the following is true: \
\
Turn off: A mechanism is available to turn the shortcut off; \
Remap: A mechanism is available to remap the shortcut to use one or more non-printable keyboard characters (e.g. Ctrl, Alt, etc); \
Active only on focus: The keyboard shortcut for a user interface component is only active when that component has focus. \
'
//2_2_1.js

@@ -264,2 +327,6 @@ ,"2_2_1_F40.2" : 'Meta refresh tag used to redirect to another page, with a time limit that is not zero. Users cannot control this time limit.'

//2_2_6.js
,"2_2_6.Check" : 'Check that users are warned of the duration of any user inactivity that could cause data loss, unless the data is preserved for more than 20 hours when the user does not take any actions.'
//2_3_1.js

@@ -273,2 +340,6 @@ ,"2_3_1_G19,G176" : 'Check that no component of the content flashes more than three times in any 1-second period, or that the size of any flashing area is sufficiently small.'

//2_3_3.js
,"2_3_3.Check" : 'Check that motion animation triggered by interaction can be disabled, unless the animation is essential to the functionality or the information being conveyed.'
//2_4_1.js

@@ -320,3 +391,57 @@ ,"2_4_1_H64.1" : 'Iframe element requires a non-empty title attribute that identifies the frame.'

//2_5_1.js
,"2_5_1.Check" : 'Check that all functionality that uses multipoint or path-based gestures for operation can be operated with a single pointer without a path-based gesture, unless a multipoint or path-based gesture is essential.'
//2_5_2.js
,"2_5_2.SinglePointer_Check" : "Check that for functionality that can be operated using a single pointer, at least one of the following is true: \
No Down-Event: The down-event of the pointer is not used to execute any part of the function; \
Abort or Undo: Completion of the function is on the up-event, and a mechanism is available to abort the function before completion or to undo the function after completion; \
Up Reversal: The up-event reverses any outcome of the preceding down-event; \
Essential: Completing the function on the down-event is essential."
,"2_5_2.Mousedown_Check" : "This element has an mousedown event listener. Check that for functionality that can be operated using a single pointer, at least one of the following is true: \
No Down-Event: The down-event of the pointer is not used to execute any part of the function; \
Abort or Undo: Completion of the function is on the up-event, and a mechanism is available to abort the function before completion or to undo the function after completion; \
Up Reversal: The up-event reverses any outcome of the preceding down-event; \
Essential: Completing the function on the down-event is essential."
,"2_5_2.Touchstart_Check" : "This element has a touchstart event listener. Check that for functionality that can be operated using a single pointer, at least one of the following is true: \
\
No Down-Event: The down-event of the pointer is not used to execute any part of the function; \
Abort or Undo: Completion of the function is on the up-event, and a mechanism is available to abort the function before completion or to undo the function after completion; \
Up Reversal: The up-event reverses any outcome of the preceding down-event; \
Essential: Completing the function on the down-event is essential."
//2_5_3.js
,"2_5_3_F96.Check" : "Check that for user interface components with labels that include text or images of text, the name contains the text that is presented visually."
,"2_5_3_F96.AccessibleName" : "Accessible name for this element does not contain the visible label text. Check that for user interface components with labels that include text or images of text, the name contains the text that is presented visually."
//2_5_4.js
,"2_5_4.Check" : "Check that functionality that can be operated by device motion or user motion can also be operated by user interface components and responding to the motion can be disabled to prevent accidental actuation, except when: \
\
Supported Interface: The motion is used to operate functionality through an accessibility supported interface; \
Essential: The motion is essential for the function and doing so would invalidate the activity. \
"
,"2_5_4.Devicemotion" : "This element has a devicemotion event listener. Check that functionality that can be operated by device motion or user motion can also be operated by user interface components and responding to the motion can be disabled to prevent accidental actuation, except when: \
\
Supported Interface: The motion is used to operate functionality through an accessibility supported interface; \
Essential: The motion is essential for the function and doing so would invalidate the activity. \
"
//2_5_5.js
,"2_5_5.Check" : 'Check that the size of the target for pointer inputs is at least 44 by 44 CSS pixels except when: \
\
Equivalent: The target is available through an equivalent link or control on the same page that is at least 44 by 44 CSS pixels; \
Inline: The target is in a sentence or block of text; \
User Agent Control: The size of the target is determined by the user agent and is not modified by the author; \
Essential: A particular presentation of the target is essential to the information being conveyed. \
'
//2_5_6.js
,"2_5_6.Check" : 'Check that the content does not restrict use of input modalities available on a platform except where the restriction is essential, required to ensure the security of the content, or required to respect user settings.'
//3_1_1.js

@@ -396,3 +521,2 @@ ,"3_1_1_H57.2" : 'The html element should have a lang or xml:lang attribute which describes the language of the document.'

//4_1_1.js

@@ -422,2 +546,6 @@ ,"4_1_1_F77" : 'Duplicate id attribute value "{{id}}" found on the web page.'

//4_1_3.js
,"4_1_3_ARIA22,G199,ARIA19,G83,G84,G85,G139,G177,G194,ARIA23.Check" : 'Check that status messages can be programmatically determined through role or properties such that they can be presented to the user by assistive technologies without receiving focus.'
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc