File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
accessibility-checker-engine/src/v4/rules Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { eRulePolicy, eToolkitLevel } from "../api/IRule";
16
16
import { RPTUtil } from "../../v2/checker/accessibility/util/legacy" ;
17
17
import { DOMUtil } from "../../v2/dom/DOMUtil" ;
18
18
import { VisUtil } from "../../v2/dom/VisUtil" ;
19
+ import { ARIAMapper } from "../../v2/aria/ARIAMapper" ;
19
20
20
21
export let table_headers_ref_valid : Rule = {
21
22
id : "table_headers_ref_valid" ,
@@ -50,8 +51,9 @@ export let table_headers_ref_valid: Rule = {
50
51
run : ( context : RuleContext , options ?: { } , contextHierarchies ?: RuleContextHierarchy ) : RuleResult | RuleResult [ ] => {
51
52
const ruleContext = context [ "dom" ] . node as Element ;
52
53
let parentTable = RPTUtil . getAncestor ( ruleContext , "table" ) ;
54
+ let parentRole = ARIAMapper . nodeToRole ( parentTable ) ;
53
55
// If this is a layout table or a simple table the rule does not apply.
54
- if ( parentTable == null || ! VisUtil . isNodeVisible ( parentTable ) || ! RPTUtil . isDataTable ( parentTable ) )
56
+ if ( parentTable == null || ! VisUtil . isNodeVisible ( parentTable ) || ! [ "table" , "grid" ] . includes ( parentRole ) )
55
57
return null ;
56
58
57
59
let nodeName = ruleContext . nodeName . toLowerCase ( ) ;
You can’t perform that action at this time.
0 commit comments