elements should contain descriptive text"
+ }
+ },
+ rulesets: [{
+ "id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
+ "num": ["1.1.1"],
+ "level": IRule_2.eRulePolicy.RECOMMENDATION,
+ "toolkitLevel": IRule_2.eToolkitLevel.LEVEL_FOUR
+ }],
+ act: {},
+ run: function (context, options, contextHierarchies) {
+ var ruleContext = context["dom"].node;
+ //skip the rule
+ if (legacy_1.RPTUtil.isNodeHiddenFromAT(ruleContext))
+ return null;
+ var passed = legacy_1.RPTUtil.hasInnerContentHidden(ruleContext);
+ if (passed)
+ return (0, IRule_1.RulePass)("Pass_0");
+ if (!passed)
+ return (0, IRule_1.RulePotential)("Potential_1");
+ }
+};
+
+
+/***/ }),
+
+/***/ "./src/v4/rules/sort/me/Valerie_Table_DataCellRelationships.ts":
+/*!*********************************************************************!*\
+ !*** ./src/v4/rules/sort/me/Valerie_Table_DataCellRelationships.ts ***!
+ \*********************************************************************/
+/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
+
+
+/******************************************************************************
+ Copyright:: 2022- IBM, Inc
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*****************************************************************************/
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.Valerie_Table_DataCellRelationships = void 0;
+var IRule_1 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var IRule_2 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var legacy_1 = __webpack_require__(/*! ../../../../v2/checker/accessibility/util/legacy */ "./src/v2/checker/accessibility/util/legacy.ts");
+exports.Valerie_Table_DataCellRelationships = {
+ id: "Valerie_Table_DataCellRelationships",
+ context: "dom:td, dom:th",
+ help: {
+ "en-US": {
+ "Pass_0": "Valerie_Table_DataCellRelationships.html",
+ "Fail_1": "Valerie_Table_DataCellRelationships.html",
+ "group": "Valerie_Table_DataCellRelationships.html"
+ }
+ },
+ messages: {
+ "en-US": {
+ "Pass_0": "Rule Passed",
+ "Fail_1": "Complex table does not have headers for each cell properly defined with 'header' or 'scope'",
+ "group": "For a complex data table, all and | elements must be related via 'header' or 'scope' attributes"
+ }
+ },
+ rulesets: [{
+ "id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
+ "num": ["1.3.1"],
+ "level": IRule_2.eRulePolicy.VIOLATION,
+ "toolkitLevel": IRule_2.eToolkitLevel.LEVEL_TWO
+ }],
+ act: {},
+ run: function (context, options, contextHierarchies) {
+ var ruleContext = context["dom"].node;
+ var parentTable = legacy_1.RPTUtil.getAncestor(ruleContext, "table");
+ // If this is a layout table or a simple table the rule does not apply.
+ if (parentTable == null || !legacy_1.RPTUtil.isComplexDataTable(parentTable))
+ return null;
+ // If this table hasn't been preprocessed, process it.
+ if (legacy_1.RPTUtil.getCache(ruleContext, "Valerie_Table_DataCellRelationships", null) === null) {
+ // Build a grid that's actually usable (rowspan and colspan elements are duplicated)
+ // This builds a real 2d table array.
+ var grid = [];
+ for (var i = 0; i < parentTable.rows.length; ++i) {
+ var row = parentTable.rows[i];
+ if (!grid[i])
+ grid[i] = [];
+ for (var j = 0; j < row.cells.length; ++j) {
+ var cell = row.cells[j];
+ legacy_1.RPTUtil.setCache(cell, "Valerie_Table_DataCellRelationships", i + ":" + j);
+ var width = parseInt(cell.getAttribute("colspan"));
+ if (!width)
+ width = 1;
+ var height = parseInt(cell.getAttribute("rowspan"));
+ if (!height)
+ height = 1;
+ var gX = 0;
+ while (grid[i][gX])
+ gX += 1;
+ for (var k = 0; k < height; ++k) {
+ if (!grid[i + k])
+ grid[i + k] = [];
+ for (var l = 0; l < width; ++l) {
+ grid[i + k][gX + l] = cell;
+ }
+ }
+ }
+ }
+ // Iterate through the table grid and record headers that point to cells and
+ // cells that are pointed to by headers
+ var doc = ruleContext.ownerDocument;
+ var lookup = {};
+ var scopedCols = {};
+ for (var i = 0; i < grid.length; ++i) {
+ var rowScoped = false;
+ for (var j = 0; j < grid[i].length; ++j) {
+ var gridCell = grid[i][j];
+ var gridNodeName = gridCell.nodeName.toLowerCase();
+ if (gridNodeName == "th") {
+ if (gridCell.getAttribute("scope") == "row") {
+ rowScoped = true;
+ // If there's an axis attribute, it must be referred to by headers,
+ // scope is not enough.
+ if (!legacy_1.RPTUtil.attributeNonEmpty(gridCell, "axis"))
+ lookup[legacy_1.RPTUtil.getCache(gridCell, "Valerie_Table_DataCellRelationships", null)] = true;
+ }
+ else if (gridCell.getAttribute("scope") == "col") {
+ scopedCols[j] = true;
+ // If there's an axis attribute, it must be referred to by headers,
+ // scope is not enough.
+ if (!legacy_1.RPTUtil.attributeNonEmpty(gridCell, "axis"))
+ lookup[legacy_1.RPTUtil.getCache(gridCell, "Valerie_Table_DataCellRelationships", null)] = true;
+ }
+ // Headers can refer to other headers
+ if (legacy_1.RPTUtil.attributeNonEmpty(gridCell, "headers")) {
+ var hdrs = gridCell.getAttribute("headers").split(" ");
+ for (var k = 0; k < hdrs.length; ++k) {
+ var headElem = doc.getElementById(hdrs[k].trim());
+ if (headElem && legacy_1.RPTUtil.getAncestor(headElem, "table") == parentTable) {
+ lookup[legacy_1.RPTUtil.getCache(headElem, "Valerie_Table_DataCellRelationships", null)] = true;
+ }
+ }
+ }
+ }
+ else if (gridNodeName == "td") {
+ if (rowScoped || scopedCols[j]) {
+ lookup[legacy_1.RPTUtil.getCache(gridCell, "Valerie_Table_DataCellRelationships", null)] = true;
+ }
+ else if (legacy_1.RPTUtil.attributeNonEmpty(gridCell, "headers")) {
+ var hdrs = gridCell.getAttribute("headers").split(" ");
+ for (var k = 0; k < hdrs.length; ++k) {
+ var headElem = doc.getElementById(hdrs[k].trim());
+ if (headElem && legacy_1.RPTUtil.getAncestor(headElem, "table") == parentTable) {
+ lookup[legacy_1.RPTUtil.getCache(gridCell, "Valerie_Table_DataCellRelationships", null)] = true;
+ lookup[legacy_1.RPTUtil.getCache(headElem, "Valerie_Table_DataCellRelationships", null)] = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ legacy_1.RPTUtil.setCache(parentTable, "Valerie_Table_DataCellRelationships", lookup);
+ }
+ var rcInfo = legacy_1.RPTUtil.getCache(ruleContext, "Valerie_Table_DataCellRelationships", null);
+ var tInfo = legacy_1.RPTUtil.getCache(parentTable, "Valerie_Table_DataCellRelationships", null);
+ var passed = rcInfo !== null && tInfo !== null && rcInfo in tInfo;
+ if (!passed && rcInfo === "0:0" &&
+ legacy_1.RPTUtil.getInnerText(ruleContext).trim().length == 0) {
+ // We don't test if it's the upper-left cell and it's empty
+ return null;
+ }
+ // If the table has no th's, it may just be that this was supposed to be a layout
+ // table, which introduces a lot of noise. In that case, only trigger this error
+ // once per table.
+ if (!passed && parentTable.getElementsByTagName("th").length == 0) {
+ if (legacy_1.RPTUtil.getCache(parentTable, "Valerie_Table_DataCellRelationships_TrigOnce", false) === true) {
+ passed = true;
+ }
+ else {
+ legacy_1.RPTUtil.setCache(parentTable, "Valerie_Table_DataCellRelationships_TrigOnce", true);
+ }
+ }
+ if (!passed) {
+ return (0, IRule_1.RuleFail)("Fail_1");
+ }
+ else {
+ return (0, IRule_1.RulePass)("Pass_0");
+ }
+ }
+};
+
+
+/***/ }),
+
+/***/ "./src/v4/rules/sort/me/WCAG20_Body_FirstAContainsSkipText_Native_Host_Sematics.ts":
+/*!*****************************************************************************************!*\
+ !*** ./src/v4/rules/sort/me/WCAG20_Body_FirstAContainsSkipText_Native_Host_Sematics.ts ***!
+ \*****************************************************************************************/
+/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
+
+
+/******************************************************************************
+ Copyright:: 2022- IBM, Inc
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*****************************************************************************/
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.WCAG20_Body_FirstAContainsSkipText_Native_Host_Sematics = void 0;
+var IRule_1 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var IRule_2 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var legacy_1 = __webpack_require__(/*! ../../../../v2/checker/accessibility/util/legacy */ "./src/v2/checker/accessibility/util/legacy.ts");
+exports.WCAG20_Body_FirstAContainsSkipText_Native_Host_Sematics = {
+ id: "WCAG20_Body_FirstAContainsSkipText_Native_Host_Sematics",
+ context: "dom:body",
+ dependencies: ["WCAG20_Body_FirstASkips_Native_Host_Sematics"],
+ help: {
+ "en-US": {
+ "Pass_0": "WCAG20_Body_FirstAContainsSkipText_Native_Host_Sematics.html",
+ "Potential_1": "WCAG20_Body_FirstAContainsSkipText_Native_Host_Sematics.html",
+ "group": "WCAG20_Body_FirstAContainsSkipText_Native_Host_Sematics.html"
+ }
+ },
+ messages: {
+ "en-US": {
+ "Pass_0": "Rule Passed",
+ "Potential_1": "Verify that if this hyperlink skips content, the description communicates where it links to",
+ "group": "The description of a hyperlink used to skip content must communicate where it links to"
+ }
+ },
+ rulesets: [{
+ "id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
+ "num": ["2.4.1"],
+ "level": IRule_2.eRulePolicy.VIOLATION,
+ "toolkitLevel": IRule_2.eToolkitLevel.LEVEL_THREE
+ }],
+ act: {},
+ run: function (context, options, contextHierarchies) {
+ var validateParams = {
+ paramSkipText: {
+ value: ["skip", "jump"],
+ type: "[string]"
+ }
+ };
+ var ruleContext = context["dom"].node;
+ // Get the anchors on the page
+ var doc = ruleContext.ownerDocument;
+ // Check for landmarks first
+ var passed;
+ if (legacy_1.RPTUtil.getCache(ruleContext, "IBM_hasLandmarks_Implicit", null) === null) {
+ legacy_1.RPTUtil.setCache(ruleContext, "IBM_hasLandmarks_Implicit", legacy_1.RPTUtil.getElementsByRoleHidden(ruleContext.ownerDocument, ["application", "banner", "complementary", "contentinfo",
+ "form", "main", "navigation", "search"
+ ], true, true).length > 0);
+ }
+ passed = legacy_1.RPTUtil.getCache(ruleContext, "IBM_hasLandmarks_Implicit", false);
+ if (!passed) { // No landmarks, check for skip links
+ var links = doc.links;
+ // Skip link should be the first one on the page with an href attribute (i.e., links[0])
+ // also if the first link is hidden then we should also trigger a violation.
+ if (links && links.length > 0 && legacy_1.RPTUtil.isNodeVisible(links[0])) {
+ var testText = legacy_1.RPTUtil.getInnerText(doc.links[0]).toLowerCase();
+ for (var i = 0; !passed && i < validateParams.paramSkipText.value.length; ++i) {
+ passed = testText.indexOf(validateParams.paramSkipText.value[i]) != -1;
+ }
+ }
+ else
+ passed = false;
+ }
+ if (passed)
+ return (0, IRule_1.RulePass)("Pass_0");
+ if (!passed)
+ return (0, IRule_1.RulePotential)("Potential_1");
+ }
+};
+
+
+/***/ }),
+
+/***/ "./src/v4/rules/sort/me/WCAG20_Body_FirstASkips_Native_Host_Sematics.ts":
+/*!******************************************************************************!*\
+ !*** ./src/v4/rules/sort/me/WCAG20_Body_FirstASkips_Native_Host_Sematics.ts ***!
+ \******************************************************************************/
+/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
+
+
+/******************************************************************************
+ Copyright:: 2022- IBM, Inc
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*****************************************************************************/
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.WCAG20_Body_FirstASkips_Native_Host_Sematics = void 0;
+var IRule_1 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var IRule_2 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var legacy_1 = __webpack_require__(/*! ../../../../v2/checker/accessibility/util/legacy */ "./src/v2/checker/accessibility/util/legacy.ts");
+var ancestor_1 = __webpack_require__(/*! ../../../../v2/checker/accessibility/util/ancestor */ "./src/v2/checker/accessibility/util/ancestor.ts");
+exports.WCAG20_Body_FirstASkips_Native_Host_Sematics = {
+ id: "WCAG20_Body_FirstASkips_Native_Host_Sematics",
+ context: "dom:body",
+ help: {
+ "en-US": {
+ "Pass_0": "WCAG20_Body_FirstASkips_Native_Host_Sematics.html",
+ "Fail_1": "WCAG20_Body_FirstASkips_Native_Host_Sematics.html",
+ "group": "WCAG20_Body_FirstASkips_Native_Host_Sematics.html"
+ }
+ },
+ messages: {
+ "en-US": {
+ "Pass_0": "Rule Passed",
+ "Fail_1": "The page does not provide a way to quickly navigate to the main content (ARIA \"main\" landmark or a skip link)",
+ "group": "Pages must provide a way to skip directly to the main content"
+ }
+ },
+ rulesets: [{
+ "id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
+ "num": ["2.4.1"],
+ "level": IRule_2.eRulePolicy.VIOLATION,
+ "toolkitLevel": IRule_2.eToolkitLevel.LEVEL_THREE
+ }],
+ act: {},
+ run: function (context, options, contextHierarchies) {
+ // This rule does not apply inside a presentational frame
+ if (ancestor_1.AncestorUtil.isPresentationFrame(contextHierarchies)) {
+ return null;
+ }
+ var ruleContext = context["dom"].node;
+ // Get the anchors on the page
+ var doc = ruleContext.ownerDocument;
+ // Check for landmarks first
+ var passed;
+ if (legacy_1.RPTUtil.getCache(ruleContext, "IBM_hasLandmarks_Implicit", null) === null) {
+ legacy_1.RPTUtil.setCache(ruleContext, "IBM_hasLandmarks_Implicit", legacy_1.RPTUtil.getElementsByRoleHidden(ruleContext.ownerDocument, ["application", "banner", "complementary", "contentinfo",
+ "form", "main", "navigation", "search"
+ ], true, true).length > 0);
+ }
+ passed = legacy_1.RPTUtil.getCache(ruleContext, "IBM_hasLandmarks_Implicit", false);
+ if (!passed) { // No landmarks, check for skip links
+ var anchors = legacy_1.RPTUtil.getDocElementsByTag(ruleContext, "a");
+ // Skip anchor should be the first one on the page with an href attribute
+ var testAnchor = null;
+ for (var i = 0; i < anchors.length; ++i) {
+ if (anchors[i].hasAttribute("href") && legacy_1.RPTUtil.isNodeVisible(anchors[i])) {
+ testAnchor = anchors[i];
+ break;
+ }
+ }
+ // Pull out the target id
+ var targetId = null;
+ if (testAnchor != null) {
+ var hrefStr = testAnchor.getAttribute("href");
+ var idx = hrefStr.indexOf("#");
+ if (idx != -1) {
+ targetId = hrefStr.substring(idx + 1);
+ }
+ }
+ // Determine if there is an element id or named anchor on the page with this
+ // target id.
+ if (targetId != null) {
+ passed = doc.getElementById(targetId) != null;
+ for (var i = 0; !passed && i < anchors.length; ++i) {
+ if (!anchors[i].hasAttribute("href") &&
+ anchors[i].hasAttribute("name") &&
+ anchors[i].getAttribute("name") == targetId) {
+ passed = true;
+ }
+ }
+ }
+ }
+ //return new ValidationResult(passed, [ruleContext], '', '', []);
+ if (!passed) {
+ return (0, IRule_1.RuleFail)("Fail_1");
+ }
+ else {
+ return (0, IRule_1.RulePass)("Pass_0");
+ }
+ }
+};
+
+
+/***/ }),
+
+/***/ "./src/v4/rules/sort/me/WCAG20_Doc_HasTitle.ts":
+/*!*****************************************************!*\
+ !*** ./src/v4/rules/sort/me/WCAG20_Doc_HasTitle.ts ***!
+ \*****************************************************/
+/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
+
+
+/******************************************************************************
+ Copyright:: 2022- IBM, Inc
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*****************************************************************************/
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.WCAG20_Doc_HasTitle = void 0;
+var IRule_1 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var IRule_2 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var legacy_1 = __webpack_require__(/*! ../../../../v2/checker/accessibility/util/legacy */ "./src/v2/checker/accessibility/util/legacy.ts");
+var ancestor_1 = __webpack_require__(/*! ../../../../v2/checker/accessibility/util/ancestor */ "./src/v2/checker/accessibility/util/ancestor.ts");
+exports.WCAG20_Doc_HasTitle = {
+ id: "WCAG20_Doc_HasTitle",
+ context: "dom:html",
+ help: {
+ "en-US": {
+ "Pass_0": "WCAG20_Doc_HasTitle.html",
+ "Fail_1": "WCAG20_Doc_HasTitle.html",
+ "Fail_2": "WCAG20_Doc_HasTitle.html",
+ "Fail_3": "WCAG20_Doc_HasTitle.html",
+ "group": "WCAG20_Doc_HasTitle.html"
+ }
+ },
+ messages: {
+ "en-US": {
+ "Pass_0": "Rule Passed",
+ "Fail_1": "Missing element so there can be no element present",
+ "Fail_2": "Missing element in element",
+ "Fail_3": "The element is empty (no innerHTML)",
+ "group": "The page should have a title that correctly identifies the subject of the page"
+ }
+ },
+ rulesets: [{
+ "id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
+ "num": ["2.4.2"],
+ "level": IRule_2.eRulePolicy.VIOLATION,
+ "toolkitLevel": IRule_2.eToolkitLevel.LEVEL_ONE
+ }],
+ act: {},
+ run: function (context, options, contextHierarchies) {
+ // This rule does not apply inside a presentational frame
+ if (ancestor_1.AncestorUtil.isFrame(contextHierarchies)) {
+ return null;
+ }
+ var ruleContext = context["dom"].node;
+ // First, find the head element
+ var findHead = ruleContext.firstChild;
+ var findTitle = null;
+ while (findHead != null) {
+ if (findHead.nodeName.toLowerCase() == "head")
+ break;
+ findHead = findHead.nextSibling;
+ }
+ var possibleTitles = ruleContext.querySelectorAll("title");
+ for (var idx = 0; idx < possibleTitles.length; ++idx) {
+ if (!legacy_1.RPTUtil.getAncestor(possibleTitles[idx], ["svg"])) {
+ findTitle = possibleTitles[idx];
+ break;
+ }
+ }
+ if (findHead === null) {
+ if (!findTitle) {
+ return (0, IRule_1.RuleFail)("Fail_1");
+ }
+ }
+ if (findTitle === null) { // don't have title second PoF
+ return (0, IRule_1.RuleFail)("Fail_2");
+ }
+ // if we get here we have and
+ if (findTitle != null && legacy_1.RPTUtil.getInnerText(findTitle).trim().length > 0) {
+ return (0, IRule_1.RulePass)("Pass_0");
+ }
+ else { // has no innerHTML third PoF
+ return (0, IRule_1.RuleFail)("Fail_3");
+ }
+ }
+};
+
+
+/***/ }),
+
+/***/ "./src/v4/rules/sort/me/WCAG20_Elem_Lang_Valid.ts":
+/*!********************************************************!*\
+ !*** ./src/v4/rules/sort/me/WCAG20_Elem_Lang_Valid.ts ***!
+ \********************************************************/
+/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
+
+
+/******************************************************************************
+ Copyright:: 2022- IBM, Inc
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*****************************************************************************/
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.WCAG20_Elem_Lang_Valid = void 0;
+var IRule_1 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var IRule_2 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var lang_1 = __webpack_require__(/*! ../../../../v2/checker/accessibility/util/lang */ "./src/v2/checker/accessibility/util/lang.ts");
+exports.WCAG20_Elem_Lang_Valid = {
+ id: "WCAG20_Elem_Lang_Valid",
+ context: "dom:*[lang], dom:*[xml:lang]",
+ help: {
+ "en-US": {
+ "Pass_0": "WCAG20_Elem_Lang_Valid.html",
+ "Fail_1": "WCAG20_Elem_Lang_Valid.html",
+ "Fail_2": "WCAG20_Elem_Lang_Valid.html",
+ "Fail_3": "WCAG20_Elem_Lang_Valid.html",
+ "Fail_4": "WCAG20_Elem_Lang_Valid.html",
+ "group": "WCAG20_Elem_Lang_Valid.html"
+ }
+ },
+ messages: {
+ "en-US": {
+ "Pass_0": "Lang has a valid primary lang and conforms to BCP 47",
+ "Fail_1": "Specified 'lang' attribute does not include a valid primary language",
+ "Fail_2": "Specified 'lang' attribute does not conform to BCP 47",
+ "Fail_3": "Specified 'lang' attribute does not include a valid primary language",
+ "Fail_4": "Specified 'xml:lang' attribute does not conform to BCP 47",
+ "group": "The language of content must be valid and specified in accordance with BCP 47"
+ }
+ },
+ rulesets: [{
+ "id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
+ "num": ["3.1.2"],
+ "level": IRule_2.eRulePolicy.VIOLATION,
+ "toolkitLevel": IRule_2.eToolkitLevel.LEVEL_THREE
+ }],
+ act: {},
+ run: function (context, options, contextHierarchies) {
+ var ruleContext = context["dom"].node;
+ var nodeName = ruleContext.nodeName.toLowerCase();
+ if (ruleContext.hasAttribute("lang")) {
+ if (nodeName !== "html" && ruleContext.getAttribute("lang") === "") {
+ // It's okay to have a lang="" if not on html
+ }
+ else {
+ var langStr = ruleContext.getAttribute("lang");
+ if (!lang_1.LangUtil.validPrimaryLang(langStr)) {
+ return (0, IRule_1.RuleFail)("Fail_1");
+ }
+ if (!lang_1.LangUtil.isBcp47(langStr)) {
+ return (0, IRule_1.RuleFail)("Fail_2");
+ }
+ }
+ }
+ if (ruleContext.hasAttribute("xml:lang")) {
+ if (nodeName !== "html" && ruleContext.getAttribute("xml:lang") === "") {
+ // It's okay to have a lang="" if not on html
+ }
+ else {
+ var langStr = ruleContext.getAttribute("xml:lang");
+ if (!lang_1.LangUtil.validPrimaryLang(langStr)) {
+ return (0, IRule_1.RuleFail)("Fail_3");
+ }
+ if (!lang_1.LangUtil.isBcp47(langStr)) {
+ return (0, IRule_1.RuleFail)("Fail_4");
+ }
+ }
+ }
+ return (0, IRule_1.RulePass)("Pass_0");
+ }
+};
+
+
+/***/ }),
+
+/***/ "./src/v4/rules/sort/me/WCAG20_Elem_UniqueAccessKey.ts":
+/*!*************************************************************!*\
+ !*** ./src/v4/rules/sort/me/WCAG20_Elem_UniqueAccessKey.ts ***!
+ \*************************************************************/
+/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
+
+
+/******************************************************************************
+ Copyright:: 2022- IBM, Inc
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*****************************************************************************/
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.WCAG20_Elem_UniqueAccessKey = void 0;
+var IRule_1 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var IRule_2 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var legacy_1 = __webpack_require__(/*! ../../../../v2/checker/accessibility/util/legacy */ "./src/v2/checker/accessibility/util/legacy.ts");
+exports.WCAG20_Elem_UniqueAccessKey = {
+ id: "WCAG20_Elem_UniqueAccessKey",
+ context: "dom:*[accesskey]",
+ help: {
+ "en-US": {
+ "Pass_0": "WCAG20_Elem_UniqueAccessKey.html",
+ "Fail_1": "WCAG20_Elem_UniqueAccessKey.html",
+ "group": "WCAG20_Elem_UniqueAccessKey.html"
+ }
+ },
+ messages: {
+ "en-US": {
+ "Pass_0": "Rule Passed",
+ "Fail_1": "'accesskey' attribute value on the element is not unique",
+ "group": "'accesskey' attribute values on each element must be unique for the page"
+ }
+ },
+ rulesets: [{
+ "id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
+ "num": ["4.1.1"],
+ "level": IRule_2.eRulePolicy.VIOLATION,
+ "toolkitLevel": IRule_2.eToolkitLevel.LEVEL_THREE
+ }],
+ act: {},
+ run: function (context, options, contextHierarchies) {
+ var ruleContext = context["dom"].node;
+ var map = legacy_1.RPTUtil.getCache(ruleContext.ownerDocument, "WCAG20_Elem_UniqueAccessKey", {});
+ var key = ruleContext.getAttribute("accesskey");
+ var passed = !(key in map);
+ map[key] = true;
+ if (!passed) {
+ return (0, IRule_1.RuleFail)("Fail_1");
+ }
+ else {
+ return (0, IRule_1.RulePass)("Pass_0");
+ }
+ }
+};
+
+
+/***/ }),
+
+/***/ "./src/v4/rules/sort/me/WCAG20_Embed_HasNoEmbed.ts":
+/*!*********************************************************!*\
+ !*** ./src/v4/rules/sort/me/WCAG20_Embed_HasNoEmbed.ts ***!
+ \*********************************************************/
+/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
+
+
+/******************************************************************************
+ Copyright:: 2022- IBM, Inc
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*****************************************************************************/
+Object.defineProperty(exports, "__esModule", ({ value: true }));
+exports.WCAG20_Embed_HasNoEmbed = void 0;
+var IRule_1 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+var IRule_2 = __webpack_require__(/*! ../../../api/IRule */ "./src/v4/api/IRule.ts");
+exports.WCAG20_Embed_HasNoEmbed = {
+ id: "WCAG20_Embed_HasNoEmbed",
+ context: "dom:embed",
+ help: {
+ "en-US": {
+ "Pass_0": "WCAG20_Embed_HasNoEmbed.html",
+ "Potential_1": "WCAG20_Embed_HasNoEmbed.html",
+ "group": "WCAG20_Embed_HasNoEmbed.html"
+ }
+ },
+ messages: {
+ "en-US": {
+ "Pass_0": "Rule Passed",
+ "Potential_1": "Verify that the |