From 83f7cca5886ba370e1865adcc6bbcb0b969a07af Mon Sep 17 00:00:00 2001 From: Utkarsh Chaudhary Date: Thu, 14 Nov 2024 15:10:13 +0530 Subject: [PATCH 1/3] Update in getOverflowHiddenAncestors for accessible text --- lib/commons/dom/get-overflow-hidden-ancestors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commons/dom/get-overflow-hidden-ancestors.js b/lib/commons/dom/get-overflow-hidden-ancestors.js index 79ca04ce..4a2bbcf8 100644 --- a/lib/commons/dom/get-overflow-hidden-ancestors.js +++ b/lib/commons/dom/get-overflow-hidden-ancestors.js @@ -28,7 +28,7 @@ const getOverflowHiddenAncestors = memoize( ancestors.push(vNode); } } else { - if (overflow.includes('hidden')) { + if (overflow.includes('hidden') || overflow.includes('clip')) { ancestors.push(vNode); } } From 024fd300185c5b3cb8bbc67ff7a6514f5b7d4cbb Mon Sep 17 00:00:00 2001 From: Utkarsh Chaudhary Date: Wed, 4 Dec 2024 14:18:18 +0530 Subject: [PATCH 2/3] Added node count --- lib/core/base/rule.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/core/base/rule.js b/lib/core/base/rule.js index e42c7429..8432760a 100644 --- a/lib/core/base/rule.js +++ b/lib/core/base/rule.js @@ -12,6 +12,7 @@ import { } from '../utils'; import { isVisibleToScreenReaders } from '../../commons/dom'; import constants from '../constants'; +import cache from './cache'; export default function Rule(spec, parentAudit) { this._audit = parentAudit; @@ -245,6 +246,7 @@ Rule.prototype.run = function run(context, options = {}, resolve, reject) { try { // Matches throws an error when it lacks support for document methods nodes = this.gatherAndMatchNodes(context, options); + cache.set(this.id, nodes.length); } catch (error) { // Exit the rule execution if matches fails reject(new SupportError({ cause: error, ruleId: this.id })); From 6244b5cbecc6e23bbf1c324f929a5939a0485f9a Mon Sep 17 00:00:00 2001 From: Arjun Chikara Date: Wed, 4 Dec 2024 18:39:35 +0530 Subject: [PATCH 3/3] Back to original get overflown hidden ancestors --- lib/commons/dom/get-overflow-hidden-ancestors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commons/dom/get-overflow-hidden-ancestors.js b/lib/commons/dom/get-overflow-hidden-ancestors.js index 79ca04ce..85f0402d 100644 --- a/lib/commons/dom/get-overflow-hidden-ancestors.js +++ b/lib/commons/dom/get-overflow-hidden-ancestors.js @@ -28,7 +28,7 @@ const getOverflowHiddenAncestors = memoize( ancestors.push(vNode); } } else { - if (overflow.includes('hidden')) { + if (overflow === 'hidden') { ancestors.push(vNode); } }