From d21eac615138eaedf226a93c2b1b1e812f2e2d19 Mon Sep 17 00:00:00 2001 From: Arjun Chikara Date: Thu, 17 Apr 2025 17:11:02 +0530 Subject: [PATCH 1/3] added color contrast rule id --- lib/commons/dom/get-visible-child-text-rects.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/commons/dom/get-visible-child-text-rects.js b/lib/commons/dom/get-visible-child-text-rects.js index 7a949442..4a227864 100644 --- a/lib/commons/dom/get-visible-child-text-rects.js +++ b/lib/commons/dom/get-visible-child-text-rects.js @@ -36,7 +36,9 @@ const getVisibleChildTextRects = (node, options = {}) => { nodeRect, checkTextRectOutsideNodeBoundingRect ) && - (!cache.get('ruleId') || cache.get('ruleId') === 'reflow-4x-zoom-scroll') + (!cache.get('ruleId') || + cache.get('ruleId') === 'reflow-4x-zoom-scroll' || + cache.get('ruleId') === 'color-contrast') ) { return; } @@ -52,7 +54,9 @@ const getVisibleChildTextRects = (node, options = {}) => { // a11y-engine-domforge change if ( clientRects.length <= 0 && - ((cache.get('ruleId') && cache.get('ruleId') === 'resize-2x-zoom') || + ((cache.get('ruleId') && + (cache.get('ruleId') === 'resize-2x-zoom' || + cache.get('ruleId') === 'color-contrast')) || checkNoVisibleRectsIdentified) ) { return []; From 8f19651be141126e7e47bc128781fc0a964537b8 Mon Sep 17 00:00:00 2001 From: Arjun Chikara Date: Thu, 17 Apr 2025 17:22:14 +0530 Subject: [PATCH 2/3] removed extra check --- lib/commons/dom/get-visible-child-text-rects.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/commons/dom/get-visible-child-text-rects.js b/lib/commons/dom/get-visible-child-text-rects.js index 4a227864..7b56fc09 100644 --- a/lib/commons/dom/get-visible-child-text-rects.js +++ b/lib/commons/dom/get-visible-child-text-rects.js @@ -54,9 +54,7 @@ const getVisibleChildTextRects = (node, options = {}) => { // a11y-engine-domforge change if ( clientRects.length <= 0 && - ((cache.get('ruleId') && - (cache.get('ruleId') === 'resize-2x-zoom' || - cache.get('ruleId') === 'color-contrast')) || + ((cache.get('ruleId') && cache.get('ruleId') === 'resize-2x-zoom') || checkNoVisibleRectsIdentified) ) { return []; From 44c3c50b87128b47a9229bf8c954bcde9f49b14a Mon Sep 17 00:00:00 2001 From: Arjun Chikara Date: Fri, 18 Apr 2025 15:36:28 +0530 Subject: [PATCH 3/3] added color contrast cache --- lib/commons/dom/get-overflow-hidden-ancestors.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/commons/dom/get-overflow-hidden-ancestors.js b/lib/commons/dom/get-overflow-hidden-ancestors.js index b68432d3..138e0fb6 100644 --- a/lib/commons/dom/get-overflow-hidden-ancestors.js +++ b/lib/commons/dom/get-overflow-hidden-ancestors.js @@ -29,7 +29,8 @@ const getOverflowHiddenAncestors = memoize( } } else if ( cache.get('ruleId') && - cache.get('ruleId') === 'reflow-4x-zoom-scroll' && + (cache.get('ruleId') === 'reflow-4x-zoom-scroll' || + cache.get('ruleId') === 'color-contrast') && overflow.includes('hidden') ) { ancestors.push(vNode);