diff --git a/fast_htmlcs/HTMLCS.Util.ts b/fast_htmlcs/HTMLCS.Util.ts
index 8104a23e..4aa04c4c 100644
--- a/fast_htmlcs/HTMLCS.Util.ts
+++ b/fast_htmlcs/HTMLCS.Util.ts
@@ -125,7 +125,7 @@ _global.HTMLCS.util = {
*
* @returns {Window}
*/
- getElementWindow: function (element) {
+ getElementWindow: (element) => {
const doc = element.ownerDocument || element;
// @ts-ignore check for element window
diff --git a/fast_htmlcs/HTMLCS.ts b/fast_htmlcs/HTMLCS.ts
index 14ccd3d6..a1c5aa23 100755
--- a/fast_htmlcs/HTMLCS.ts
+++ b/fast_htmlcs/HTMLCS.ts
@@ -218,8 +218,9 @@ _global.HTMLCS = new (function () {
this.addMessage = (type, element, msg, code, data) => {
const ccode = _getMessageCode(code);
const textId = ccode + element.outerHTML;
+ const pos = _duplicates.get(textId);
- if (!_duplicates.has(textId)) {
+ if (typeof pos === "undefined") {
// track the position to use to update the prior message on duplicates.
_duplicates.set(textId, this.messages.length);
this.messages.push({
@@ -232,7 +233,6 @@ _global.HTMLCS = new (function () {
runner: "htmlcs",
});
} else {
- const pos = _duplicates.get(textId);
this.messages[pos].recurrence = this.messages[pos].recurrence + 1;
}
};
@@ -259,26 +259,25 @@ _global.HTMLCS = new (function () {
const element = elements.shift();
const tagName =
element === topElement ? "_top" : element.tagName.toLowerCase();
+ const tag = _tags.get(tagName);
- if (_tags.has(tagName)) {
- const tag = _tags.get(tagName);
-
- if (tag.length > 0) {
- // do not pass in callback
- _processSniffs(element, tag, topElement, undefined);
- }
+ if (tag && tag.length > 0) {
+ _processSniffs(element, tag, topElement, undefined);
}
}
- _currentSniff = HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1;
-
// Due to filtering of presentation roles for general sniffing these need to be handled
// separately. The 1.3.1 sniff needs to run to detect any incorrect usage of the presentation
// role.
- for (const element of topElement.querySelectorAll(
+ const presentationElements = topElement.querySelectorAll(
'[role="presentation"]'
- )) {
- _currentSniff.testSemanticPresentationRole(element);
+ );
+
+ if (presentationElements) {
+ _currentSniff = HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1;
+ for (const element of presentationElements) {
+ _currentSniff.testSemanticPresentationRole(element);
+ }
}
if (callback instanceof Function === true) {
@@ -347,10 +346,8 @@ _global.HTMLCS = new (function () {
const ruleSet = _getRuleset(part);
if (ruleSet) {
- // Already included.
this.registerStandard(standard, part, callback, failCallback, options);
} else {
- // TODO: remove _include script callback standard always included
_includeScript(
_standard,
function () {
@@ -380,7 +377,7 @@ _global.HTMLCS = new (function () {
const oldRuleSet = _getRuleset(part);
const ruleSet = {
- sniffs: undefined,
+ sniffs: [],
};
for (const x in oldRuleSet) {
@@ -396,7 +393,6 @@ _global.HTMLCS = new (function () {
if (options) {
if (options.include && options.include.length > 0) {
// Included sniffs.
- // @ts-ignore
ruleSet.sniffs = options.include;
} else if (options.exclude) {
// Excluded sniffs.
@@ -414,7 +410,6 @@ _global.HTMLCS = new (function () {
// Register the sniffs for this standard.
_registerSniffs(
standard,
- // @ts-ignore
ruleSet.sniffs.slice(0, ruleSet.sniffs.length),
callback,
failCallback
@@ -429,7 +424,7 @@ _global.HTMLCS = new (function () {
* @param {Function} callback The function to call once the sniffs are registered.
*/
const _registerSniffs = (standard, sniffs, callback, failCallback) => {
- if (sniffs.length === 0) {
+ if (!sniffs || sniffs.length === 0) {
return callback.call(this);
}
@@ -438,7 +433,7 @@ _global.HTMLCS = new (function () {
standard,
sniffs.shift(),
function () {
- _registerSniffs(standard, sniffs, callback, failCallback);
+ return _registerSniffs(standard, sniffs, callback, failCallback);
},
failCallback
);
@@ -491,21 +486,18 @@ _global.HTMLCS = new (function () {
* @param {String} sniff The name of the sniff.
*/
this.registerSniff = (standard: string, sniff: string) => {
- // Get the sniff object.
const sniffObj = _getSniff(standard, sniff);
- if (!sniffObj) {
- return false;
- }
-
// Call the register method of the sniff, it should return an array of tags.
- if (sniffObj.register) {
- const watchedTags = sniffObj.register();
-
- for (const wtag of watchedTags) {
- !_tags.has(wtag)
- ? _tags.set(wtag, [sniffObj])
- : _tags.get(wtag).push(sniffObj);
+ if (sniffObj && "register" in sniffObj) {
+ for (const wtag of sniffObj.register) {
+ const tag = _tags.get(wtag);
+
+ if (!tag) {
+ _tags.set(wtag, [sniffObj]);
+ } else {
+ tag.push(sniffObj);
+ }
}
}
};
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/A.ts b/fast_htmlcs/Standards/Section508/Sniffs/A.ts
index 708ac8e3..5e870f8d 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/A.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/A.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_A = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top", "img", "object", "bgsound", "audio"],
+ get register() {
+ return ["_top", "img", "object", "bgsound", "audio"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/B.ts b/fast_htmlcs/Standards/Section508/Sniffs/B.ts
index 2032e877..ecc1a84e 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/B.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/B.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_B = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "applet", "embed", "video"],
+ get register() {
+ return ["object", "applet", "embed", "video"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_Section508_Sniffs_B = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/C.ts b/fast_htmlcs/Standards/Section508/Sniffs/C.ts
index 38779277..7ab2b682 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/C.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/C.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_C = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/D.ts b/fast_htmlcs/Standards/Section508/Sniffs/D.ts
index 873842fb..19eb310e 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/D.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/D.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_D = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
@@ -23,18 +25,19 @@ _global.HTMLCS_Section508_Sniffs_D = {
"Ensure that content is ordered in a meaningful sequence when linearised, such as when style sheets are disabled.",
"Linearised"
);
- this.testPresentationMarkup(top);
+
+ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1.testPresentationMarkup(
+ top
+ )
this.testHeadingOrder(top);
// Look for any script elements, and fire off another notice regarding
// potentially hidden text (eg. "click to expand" sections). For instance,
// such text should be stored semantically in the page, not loaded into
// a container through AJAX (and thus not accessible with scripting off).
- const hasScript = HTMLCS.util.getAllElements(
- top,
- 'script, link[rel="stylesheet"]'
- );
- if (hasScript.length > 0) {
+ if (
+ HTMLCS.util.getAllElements(top, 'script, link[rel="stylesheet"]').length
+ ) {
HTMLCS.addMessage(
HTMLCS.NOTICE,
top,
@@ -45,17 +48,6 @@ _global.HTMLCS_Section508_Sniffs_D = {
}
},
- /**
- * Test for the use of presentational elements.
- *
- * @param [DOMNode] top The top element of the tested code.
- */
- testPresentationMarkup: function (top) {
- _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1.testPresentationMarkup(
- top
- );
- },
-
testHeadingOrder: function (top) {
let lastHeading = 0;
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/G.ts b/fast_htmlcs/Standards/Section508/Sniffs/G.ts
index 94472d2b..36848411 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/G.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/G.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_G = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["table"],
+ get register() {
+ return ["table"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/H.ts b/fast_htmlcs/Standards/Section508/Sniffs/H.ts
index 9ae6e741..44eee199 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/H.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/H.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_H = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["table"],
+ get register() {
+ return ["table"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_Section508_Sniffs_H = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (table, _) {
+ process: (table, _) => {
const headersAttr = HTMLCS.util.testTableHeaders(table);
// Incorrect usage of headers - error; emit always.
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/I.ts b/fast_htmlcs/Standards/Section508/Sniffs/I.ts
index 5377e9e3..96aea22a 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/I.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/I.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_I = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["frame", "iframe", "object"],
+ get register() {
+ return ["frame", "iframe", "object"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/J.ts b/fast_htmlcs/Standards/Section508/Sniffs/J.ts
index 36968c80..c3b2dfaa 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/J.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/J.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_J = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/K.ts b/fast_htmlcs/Standards/Section508/Sniffs/K.ts
index cf1ff44a..c865f80d 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/K.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/K.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_K = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/L.ts b/fast_htmlcs/Standards/Section508/Sniffs/L.ts
index f4be889a..55125792 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/L.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/L.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_L = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/M.ts b/fast_htmlcs/Standards/Section508/Sniffs/M.ts
index 12f83ffe..d28ac57f 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/M.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/M.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_M = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "applet", "bgsound", "embed", "audio", "video"],
+ get register() {
+ return ["object", "applet", "bgsound", "embed", "audio", "video"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_Section508_Sniffs_M = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/N.ts b/fast_htmlcs/Standards/Section508/Sniffs/N.ts
index 1b645c98..af7446a4 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/N.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/N.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_N = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["form"],
+ get register() {
+ return ["form"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_Section508_Sniffs_N = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
if (element.nodeName === "FORM") {
HTMLCS.addMessage(
HTMLCS.NOTICE,
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/O.ts b/fast_htmlcs/Standards/Section508/Sniffs/O.ts
index e7e0865e..eb0a3c3a 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/O.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/O.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_O = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top", "a", "area"],
+ get register() {
+ return ["_top", "a", "area"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/Section508/Sniffs/P.ts b/fast_htmlcs/Standards/Section508/Sniffs/P.ts
index 8ecb6e6c..46b572f3 100644
--- a/fast_htmlcs/Standards/Section508/Sniffs/P.ts
+++ b/fast_htmlcs/Standards/Section508/Sniffs/P.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_Section508_Sniffs_P = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top", "meta"],
+ get register() {
+ return ["_top", "meta"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_1/1_1_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_1/1_1_1.ts
index 0361db6a..6aa60d44 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_1/1_1_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_1/1_1_1.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_1_1_1_1 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top", "img"],
+ get register() {
+ return ["_top", "img"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_1.ts
index 11637e83..580e7bd9 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_1.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_1 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "embed", "applet", "bgsound", "audio", "video"],
+ get register() {
+ return ["object", "embed", "applet", "bgsound", "audio", "video"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_1 = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
const nodeName = element.nodeName;
if (nodeName !== "VIDEO") {
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_2.ts
index 431483a0..b4d65763 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "embed", "applet", "video"],
+ get register() {
+ return ["object", "embed", "applet", "video"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_2 = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_3.ts
index 2212b562..d0c6ff4a 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "embed", "applet", "video"],
+ get register() {
+ return ["object", "embed", "applet", "video"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_4.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_4.ts
index d441601f..da54c6b8 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_4.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_4.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_4 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "embed", "applet", "video"],
+ get register() {
+ return ["object", "embed", "applet", "video"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_4 = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_5.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_5.ts
index 18667bb5..84579ca5 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_5.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_5.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_5 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "embed", "applet", "video"],
+ get register() {
+ return ["object", "embed", "applet", "video"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_5 = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_6.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_6.ts
index b4c74a81..82cfdba5 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_6.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_6.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_6 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "embed", "applet", "video"],
+ get register() {
+ return ["object", "embed", "applet", "video"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_7.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_7.ts
index 65f9d777..e2f59ded 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_7.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_7.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_7 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "embed", "applet", "video"],
+ get register() {
+ return ["object", "embed", "applet", "video"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_8.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_8.ts
index aac9b834..9c708fe2 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_8.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_8.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_8 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "embed", "applet", "video"],
+ get register() {
+ return ["object", "embed", "applet", "video"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_8 = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_9.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_9.ts
index 1683ec9a..b03d67da 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_9.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_2/1_2_9.ts
@@ -7,7 +7,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_9 = {
*
* @returns {Array} The list of elements.
*/
- register: function () {
+ get register() {
return ["object", "embed", "applet", "bgsound", "audio"];
},
@@ -17,7 +17,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_2_1_2_9 = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1.ts
index 9e48140c..029200eb 100755
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1.ts
@@ -1,24 +1,26 @@
_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1 = {
_labelNames: null,
- register: () => [
- "_top",
- "p",
- "div",
- "input",
- "select",
- "textarea",
- "button",
- "table",
- "fieldset",
- "form",
- "h1",
- "h2",
- "h3",
- "h4",
- "h5",
- "h6",
- ],
+ get register() {
+ return [
+ "_top",
+ "p",
+ "div",
+ "input",
+ "select",
+ "textarea",
+ "button",
+ "table",
+ "fieldset",
+ "form",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ ];
+ },
/**
* Process the registered element.
@@ -369,7 +371,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1 = {
*
* @param [DOMNode] top The top element of the tested code.
*/
- testPresentationMarkup: function (top) {
+ testPresentationMarkup: (top) => {
// In HTML4, the following were marked as presentational:
// b, i, u, s, strike, tt, big, small, center, font
// In HTML5, the following were repurposed as pseudo-semantic:
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1_A.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1_A.ts
index aeb30a88..bf041973 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1_A.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1_A.ts
@@ -1,8 +1,9 @@
_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1_A = {
_labelNames: null,
- register: () => ["_top"],
-
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
*
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1_AAA.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1_AAA.ts
index fca46b1f..2e212446 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1_AAA.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1_AAA.ts
@@ -1,7 +1,9 @@
_global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1_AAA = {
_labelNames: null,
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_2.ts
index 6901ce12..2fc05488 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_3.ts
index b85a5d4c..462f9380 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_4.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_4.ts
index b00a0b82..a9e40a6e 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_4.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_4.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_4 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_5.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_5.ts
index 231adc72..6933f318 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_5.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_5.ts
@@ -7,14 +7,16 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_5 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top", "input", "select", "textarea"],
+ get register() {
+ return ["_top", "input", "select", "textarea"];
+ },
/**
* Checks that the values of the autocomplete attribute are values listed in the HTML 5.2 spec.
*
* @param {DOMNode} element The element registered.
*/
- checkValidAttributes: function (element) {
+ checkValidAttributes: (element) => {
const valuesStr = element.getAttribute("autocomplete");
if (typeof valuesStr !== "string") {
@@ -117,7 +119,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_5 = {
*
* @param {DOMNode} element The element registered.
*/
- checkControlGroups: function (element) {
+ checkControlGroups: (element) => {
const textFields = [
"name",
"honorific-prefix",
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_6.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_6.ts
index 102142f4..0bb459cf 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_6.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_6.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_6 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_1.ts
index d686d347..f4c5c51a 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_1.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_1 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_10.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_10.ts
index 7d443a06..2fa14883 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_10.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_10.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_10 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top", "pre", "meta"],
+ get register() {
+ return ["_top", "pre", "meta"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_11.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_11.ts
index 7059603a..aa1d8449 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_11.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_11.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_11 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_12.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_12.ts
index 275cea61..6312bce6 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_12.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_12.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_12 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_13.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_13.ts
index 190677de..1af08348 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_13.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_13.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_13 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_2.ts
index e0bdf047..cac0bee6 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "embed", "applet", "bgsound", "audio", "video"],
+ get register() {
+ return ["object", "embed", "applet", "bgsound", "audio", "video"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_3.ts
index 04ce2821..6ad899ee 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_3_F24.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_3_F24.ts
index 7ba4cee8..af079b5d 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_3_F24.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_3_F24.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_3_F24 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
@@ -53,7 +55,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_3_F24 = {
*
* @param Node element The element to test.
*/
- testColourComboFail: function (element) {
+ testColourComboFail: (element) => {
let hasFg =
element.hasAttribute("color") ||
element.hasAttribute("link") ||
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_4.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_4.ts
index c089bc77..2aad2d7f 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_4.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_4.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_4 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_5.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_5.ts
index 7feef7d0..4547c413 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_5.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_5.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_5 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_6.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_6.ts
index 93a81f7b..1d5683f0 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_6.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_6.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_6 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_7.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_7.ts
index 4f16709a..213cf30d 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_7.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_7.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_7 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "embed", "applet", "bgsound", "audio"],
+ get register() {
+ return ["object", "embed", "applet", "bgsound", "audio"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_7 = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_8.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_8.ts
index ed1c1ace..a4f52d3e 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_8.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_8.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_8 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_9.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_9.ts
index 6a9b2845..6dbdcc2a 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_9.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_9.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_9 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_1.ts
index 657b5c27..b826eb2e 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_1.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_1_2_1_1 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_2.ts
index 684dfb92..11de6656 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_1_2_1_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["object", "applet", "embed"],
+ get register() {
+ return ["object", "applet", "embed"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_4.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_4.ts
index 7b858a13..b06de4d9 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_4.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_1/2_1_4.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_1_2_1_4 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_1.ts
index dcf1f333..4f7cd950 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_1.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_2_2_2_1 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["meta"],
+ get register() {
+ return ["meta"];
+ },
/**
* Process the registered element.
@@ -20,26 +22,27 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_2_2_2_1 = {
// NOTE: H76 only lists criterion 3.2.5, but F41 also covers refreshes to
// same page (no URL content), which is covered by non-adjustable timeouts
// in criterion 2.2.1.
- if (element.hasAttribute("http-equiv")) {
- if (element.getAttribute("http-equiv").toLowerCase() === "refresh") {
- if (/^[1-9]\d*/.test(element.getAttribute("content"))) {
- if (/url=/i.test(element.getAttribute("content"))) {
- // Redirect.
- HTMLCS.addMessage(
- HTMLCS.ERROR,
- element,
- _global.HTMLCS.getTranslation("2_2_1_F40.2"),
- "F40.2"
- );
- } else {
- // Just a refresh.
- HTMLCS.addMessage(
- HTMLCS.ERROR,
- element,
- _global.HTMLCS.getTranslation("2_2_1_F41.2"),
- "F41.2"
- );
- }
+ if (
+ element.hasAttribute("http-equiv") &&
+ element.getAttribute("http-equiv").toLowerCase() === "refresh"
+ ) {
+ if (/^[1-9]\d*/.test(element.getAttribute("content"))) {
+ if (/url=/i.test(element.getAttribute("content"))) {
+ // Redirect.
+ HTMLCS.addMessage(
+ HTMLCS.ERROR,
+ element,
+ _global.HTMLCS.getTranslation("2_2_1_F40.2"),
+ "F40.2"
+ );
+ } else {
+ // Just a refresh.
+ HTMLCS.addMessage(
+ HTMLCS.ERROR,
+ element,
+ _global.HTMLCS.getTranslation("2_2_1_F41.2"),
+ "F41.2"
+ );
}
}
}
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_2.ts
index 4c83ce71..4e86a036 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_2_2_2_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top", "blink"],
+ get register() {
+ return ["_top", "blink"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_3.ts
index 7436980d..ac14e05e 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_2_2_2_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_4.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_4.ts
index ddd6480d..cb7056ec 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_4.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_4.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_2_2_2_4 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_5.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_5.ts
index ebb8c3c4..a94710d1 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_5.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_5.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_2_2_2_5 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_6.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_6.ts
index 0d686ae9..96c7520a 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_6.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_2/2_2_6.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_2_2_2_6 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_1.ts
index 0694c36b..1720275a 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_1.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_3_2_3_1 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_2.ts
index a2920518..3627af11 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_3_2_3_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_3.ts
index cd43456a..88b1ad68 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_3/2_3_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_3_2_3_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_1.ts
index ce7c9c2f..3461cf2a 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_1.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_4_2_4_1 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["iframe", "a", "area", "_top"],
+ get register() {
+ return ["iframe", "a", "area", "_top"];
+ },
/**
* Process the registered element.
@@ -97,7 +99,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_4_2_4_1 = {
*
* @returns void
*/
- testSameDocFragmentLinks: function (element, top) {
+ testSameDocFragmentLinks: (element, top) => {
if (element.hasAttribute("href") && HTMLCS.util.isFocusable(element)) {
// has attribute checked string will always return
const href = element.getAttribute("href").trim();
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_2.ts
index e336df8a..90ea9b74 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_4_2_4_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["html"],
+ get register() {
+ return ["html"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_3.ts
index 9d63802a..63f90eca 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_4_2_4_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_4.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_4.ts
index 7df4e622..5662c80f 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_4.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_4.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_4_2_4_4 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["a"],
+ get register() {
+ return ["a"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_5.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_5.ts
index f925e071..9ce86e0c 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_5.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_5.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_4_2_4_5 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_6.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_6.ts
index 520c7a47..2b9a7b1d 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_6.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_6.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_4_2_4_6 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_7.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_7.ts
index 1879ce3f..352335f6 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_7.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_7.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_4_2_4_7 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_8.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_8.ts
index feaa59db..97196222 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_8.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_8.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_4_2_4_8 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["link"],
+ get register() {
+ return ["link"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_9.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_9.ts
index 0ad89ba1..aff70529 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_9.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_4/2_4_9.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_4_2_4_9 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["a"],
+ get register() {
+ return ["a"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_1.ts
index 848a7b70..99efba6c 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_1.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_5_2_5_1 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_2.ts
index 58016d05..72e6639d 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_5_2_5_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_3.ts
index 2a32104e..528672e4 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_5_2_5_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top", "a", "button", "label", "input"],
+ get register() {
+ return ["_top", "a", "button", "label", "input"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_4.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_4.ts
index ca21b788..f4e2f2ec 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_4.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_4.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_5_2_5_4 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_5.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_5.ts
index be091d74..cbcb5807 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_5.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_5.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_5_2_5_5 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_6.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_6.ts
index c85d83d9..35b3061b 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_6.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_6.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_5_2_5_6 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_1.ts
index 5e20660e..20c2e96a 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_1.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_1_3_1_1 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["html"],
+ get register() {
+ return ["html"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_2.ts
index f8c37ea1..9281644a 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_1_3_1_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
@@ -57,11 +59,8 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_1_3_1_2 = {
}
}
- if (langEl.hasAttribute("xml:lang") === true) {
- if (
- sc3_1_1.isValidLanguageTag(langEl.getAttribute("xml:lang")) ===
- false
- ) {
+ if (langEl.hasAttribute("xml:lang")) {
+ if (!sc3_1_1.isValidLanguageTag(langEl.getAttribute("xml:lang"))) {
HTMLCS.addMessage(
HTMLCS.ERROR,
langEl,
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_3.ts
index a41daacd..00084c90 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_1_3_1_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_4.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_4.ts
index 2077f929..23aed118 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_4.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_4.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_1_3_1_4 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_5.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_5.ts
index 916bafc9..231accca 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_5.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_5.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_1_3_1_5 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_6.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_6.ts
index bc39c040..7da19cbb 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_6.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_1/3_1_6.ts
@@ -7,7 +7,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_1_3_1_6 = {
*
* @returns {Array} The list of elements.
*/
- register: function () {
+ get register() {
return ["ruby"];
},
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_1.ts
index c62b8d58..28a27ad3 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_1.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_2_3_2_1 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["input", "textarea", "button", "select"],
+ get register() {
+ return ["input", "textarea", "button", "select"];
+ },
/**
* Process the registered element.
@@ -15,7 +17,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_2_3_2_1 = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_2.ts
index 1bc1229f..c81cb679 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_2_3_2_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["form"],
+ get register() {
+ return ["form"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_3.ts
index ead3abf7..e8bd0e64 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_2_3_2_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_4.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_4.ts
index a45e5d57..2f1ee7c4 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_4.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_4.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_2_3_2_4 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_5.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_5.ts
index 3113d29e..f7a9bfbe 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_5.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2/3_2_5.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_2_3_2_5 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["a"],
+ get register() {
+ return ["a"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_1.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_1.ts
index 1beae1f9..037f71e1 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_1.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_1.ts
@@ -7,7 +7,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_3_3_3_1 = {
*
* @returns {Array} The list of elements.
*/
- register: function () {
+ get register() {
return ["form"];
},
@@ -17,7 +17,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_3_3_3_1 = {
* @param {DOMNode} element The element registered.
* @param {DOMNode} top The top element of the tested code.
*/
- process: function (element, _) {
+ process: (element, _) => {
HTMLCS.addMessage(
HTMLCS.NOTICE,
element,
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_2.ts
index 269a85e8..2349cb5e 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_3_3_3_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["form"],
+ get register() {
+ return ["form"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_3.ts
index a8cc4d93..433d8822 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_3_3_3_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["form"],
+ get register() {
+ return ["form"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_4.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_4.ts
index c589f570..74720c47 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_4.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_4.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_3_3_3_4 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["form"],
+ get register() {
+ return ["form"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_5.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_5.ts
index 18fa886d..314b5aa2 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_5.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_5.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_3_3_3_5 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["form"],
+ get register() {
+ return ["form"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_6.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_6.ts
index 534f0f0a..bbe98c69 100644
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_6.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_3/3_3_6.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_3_3_3_6 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["form"],
+ get register() {
+ return ["form"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_2.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_2.ts
index 959a6cf5..42e168d5 100755
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_2.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_2.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle4_Guideline4_1_4_1_2 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
@@ -99,7 +101,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle4_Guideline4_1_4_1_2 = {
}
},
- processLinks: function (top) {
+ processLinks: (top) => {
const errors = {
empty: [],
emptyWithName: [],
@@ -161,18 +163,16 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle4_Guideline4_1_4_1_2 = {
errors.placeholder.push(element);
}
}
- } else {
- if (nameFound === false) {
- // 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 &&
- !HTMLCS.util.hasValidAriaLabel(element)
- ) {
- errors.noContent.push(element);
- }
+ } else if (!nameFound) {
+ // 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 &&
+ !HTMLCS.util.hasValidAriaLabel(element)
+ ) {
+ errors.noContent.push(element);
}
}
}
diff --git a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_3.ts b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_3.ts
index 1a512061..b3941812 100755
--- a/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_3.ts
+++ b/fast_htmlcs/Standards/WCAG2AAA/Sniffs/Principle4/Guideline4_1/4_1_3.ts
@@ -7,7 +7,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle4_Guideline4_1_4_1_3 = {
*
* @returns {Array} The list of elements.
*/
- register: () => ["_top"],
+ get register() {
+ return ["_top"];
+ },
/**
* Process the registered element.
diff --git a/fast_htmlcs/globals.d.ts b/fast_htmlcs/globals.d.ts
index 1e990417..b2462322 100644
--- a/fast_htmlcs/globals.d.ts
+++ b/fast_htmlcs/globals.d.ts
@@ -128,8 +128,7 @@ type RuleSet = {
// Guidelines to follow
type GuideLine = {
_labelNames?: string[];
- // primary entrys todo: move to getter
- register?(): string[];
+ register?: string[];
process?(element: Element, top?: Element): void;
// custom
addNullAltTextResults?(top: Element): void;
diff --git a/fast_htmlcs/package.json b/fast_htmlcs/package.json
index cec5c25e..f90d15bb 100644
--- a/fast_htmlcs/package.json
+++ b/fast_htmlcs/package.json
@@ -1,6 +1,6 @@
{
"name": "fast_htmlcs",
- "version": "0.0.76",
+ "version": "0.0.77",
"description": "A high performance rewrite of HTML_CodeSniffer.",
"license": "BSD-3-Clause",
"main": "index.js",
diff --git a/kayle/lib/runners/htmlcs.ts b/kayle/lib/runners/htmlcs.ts
index c6aaa9e3..71c657c8 100644
--- a/kayle/lib/runners/htmlcs.ts
+++ b/kayle/lib/runners/htmlcs.ts
@@ -72,7 +72,7 @@ const locales = [
"pl",
"ko",
"zh_CN",
- "zh_TW"
+ "zh_TW",
];
for (const lang of locales) {
diff --git a/kayle/package.json b/kayle/package.json
index 576fd408..78c7cc1f 100644
--- a/kayle/package.json
+++ b/kayle/package.json
@@ -1,6 +1,6 @@
{
"name": "kayle",
- "version": "0.8.21",
+ "version": "0.8.22",
"description": "Extremely fast and accurate accessibility engine built for any headless tool like playwright or puppeteer.",
"main": "./build/index.js",
"keywords": [
diff --git a/kayle/tests/basic-htmlcs.ts b/kayle/tests/basic-htmlcs.ts
index 4b1ebe8c..a8a41b22 100644
--- a/kayle/tests/basic-htmlcs.ts
+++ b/kayle/tests/basic-htmlcs.ts
@@ -16,9 +16,9 @@ import { performance } from "perf_hooks";
browser,
runners: ["htmlcs"],
includeWarnings: true,
- standard: Standard.WCAG2AAA,
- origin: "https://www.drake.com",
html: drakeMock,
+ standard: Standard.WCAG2AA,
+ origin: "https://www.drake.com",
});
const nextTime = performance.now() - startTime;