diff --git a/accessibility-checker-engine/karma.conf.js b/accessibility-checker-engine/karma.conf.js index 9ba11327a..bdd3f1d96 100644 --- a/accessibility-checker-engine/karma.conf.js +++ b/accessibility-checker-engine/karma.conf.js @@ -47,12 +47,12 @@ //{ pattern: 'test/v2/checker/accessibility/rules/label_name_visible_ruleunit/label_offscreen.html', watched: true }, //{ pattern: 'test/v2/checker/accessibility/rules/aria_role_valid_ruleunit/td_attribute_invalid_copy.html', watched: true }, //{ pattern: 'test/v2/checker/accessibility/rules/text_block_heading_ruleunit/Headings-noneUsedEmphasizedText.html', watched: true }, - { pattern: 'test/v2/checker/accessibility/rules/aria_parent_required_ruleunit/webComponentPass.html', watched: true }, - { pattern: 'test/v2/checker/accessibility/rules/aria_parent_required_ruleunit/webComponentPass2.html', watched: true }, + { pattern: 'test/v2/checker/accessibility/rules/aria_landmark_name_unique_ruleunit/*.html', watched: true }, + // { pattern: 'test/v2/checker/accessibility/rules/aria_parent_required_ruleunit/webComponentPass2.html', watched: true }, - { pattern: 'test/**/*_ruleunit/*.html', watched: true }, - { pattern: 'test/**/*_ruleunit/*.htm', watched: true }, + // { pattern: 'test/**/*_ruleunit/*.html', watched: true }, + // { pattern: 'test/**/*_ruleunit/*.htm', watched: true }, // all files ending in "_test" // { pattern: 'test/*_test.js', watched: true }, { pattern: 'test/**/*_test.js', watched: true } diff --git a/accessibility-checker-engine/src/v4/rules/element_accesskey_labelled.ts b/accessibility-checker-engine/src/v4/rules/element_accesskey_labelled.ts index da43f16ae..0a2551355 100644 --- a/accessibility-checker-engine/src/v4/rules/element_accesskey_labelled.ts +++ b/accessibility-checker-engine/src/v4/rules/element_accesskey_labelled.ts @@ -64,7 +64,7 @@ export const element_accesskey_labelled: Rule = { if (!roles || roles.length === 0) return; let patterns = ARIADefinitions.designPatterns[roles[0]] - if (!patterns.nameFrom) + if (!patterns || !patterns.nameFrom) return; // ignore if accessble name is required (checked in other rules) or prohibited (text element) diff --git a/accessibility-checker-engine/src/v4/util/AriaUtil.ts b/accessibility-checker-engine/src/v4/util/AriaUtil.ts index 6b5d0a90c..4823f40e1 100644 --- a/accessibility-checker-engine/src/v4/util/AriaUtil.ts +++ b/accessibility-checker-engine/src/v4/util/AriaUtil.ts @@ -768,7 +768,7 @@ export class AriaUtil { if (widget === null) { let ret = false; const role = AriaUtil.getResolvedRole(element); - if (role && ARIADefinitions.designPatterns[role].roleType === 'widget') + if (role && ARIADefinitions.designPatterns[role] && ARIADefinitions.designPatterns[role].roleType === 'widget') ret = true; CacheUtil.setCache(element.ownerDocument, "is_element_widget", ret); diff --git a/accessibility-checker-engine/src/v4/util/CommonUtil.ts b/accessibility-checker-engine/src/v4/util/CommonUtil.ts index ace859285..9b874819c 100644 --- a/accessibility-checker-engine/src/v4/util/CommonUtil.ts +++ b/accessibility-checker-engine/src/v4/util/CommonUtil.ts @@ -1646,8 +1646,8 @@ export class CommonUtil { } // truncate the given text to a given number of characters - // return truncated text - public static truncateText(text: string, len = 60) { + // return truncated text to 150 chars, same with the media_alt_brief rule + public static truncateText(text: string, len = 150) { if (!text) return text; text = text.trim(); if (text.length > len) diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/aria_landmark_name_unique_ruleunit/dcs-example.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/aria_landmark_name_unique_ruleunit/dcs-example.html new file mode 100644 index 000000000..f384c69d6 --- /dev/null +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/aria_landmark_name_unique_ruleunit/dcs-example.html @@ -0,0 +1,128 @@ + + + + + +
+