diff --git a/accessibility-checker-engine/src/v4/rules/fieldset_legend_valid.ts b/accessibility-checker-engine/src/v4/rules/fieldset_legend_valid.ts index 0f0cd5d0e..78ea0b382 100644 --- a/accessibility-checker-engine/src/v4/rules/fieldset_legend_valid.ts +++ b/accessibility-checker-engine/src/v4/rules/fieldset_legend_valid.ts @@ -14,6 +14,7 @@ import { Rule, RuleResult, RuleFail, RuleContext, RulePass, RuleContextHierarchy } from "../api/IRule"; import { eRulePolicy, eToolkitLevel } from "../api/IRule"; import { RPTUtil } from "../../v2/checker/accessibility/util/legacy"; +import { VisUtil } from "../../v2/dom/VisUtil"; export let fieldset_legend_valid: Rule = { id: "fieldset_legend_valid", @@ -52,6 +53,10 @@ export let fieldset_legend_valid: Rule = { act: [], run: (context: RuleContext, options?: {}, contextHierarchies?: RuleContextHierarchy): RuleResult | RuleResult[] => { const ruleContext = context["dom"].node as Element; + //skip if the fieldset is hidden or disabled + if (VisUtil.isNodeHiddenFromAT(ruleContext) || RPTUtil.isNodeDisabled(ruleContext)) + return null; + // In the case a legend is hidden, we should still trigger a violations for this let legends = RPTUtil.getChildByTagHidden(ruleContext, "legend", true, false); if (legends.length === 0) { diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/fieldset_legend_valid_ruleunit/FieldSet-disabled.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/fieldset_legend_valid_ruleunit/FieldSet-disabled.html new file mode 100644 index 000000000..1ddec2751 --- /dev/null +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/fieldset_legend_valid_ruleunit/FieldSet-disabled.html @@ -0,0 +1,77 @@ + + + + + + + + RPT Test Suite + + + + +skip to main content + + +

Test case: FieldSet-hasEmptyLegend.html

+ + + + + + +

Input type Tests

+ + + + +
+ + + +
+ + + + + + +