Skip to content

Commit 0a1c14b

Browse files
Fix: Revert back to original get overflown hidden ancestors else case (#113)
* Update in getOverflowHiddenAncestors for accessible text * Added node count * Back to original get overflown hidden ancestors --------- Co-authored-by: Utkarsh Chaudhary <utkarsh.ch@browserstack.com>
1 parent 4334d1a commit 0a1c14b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/commons/dom/get-overflow-hidden-ancestors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const getOverflowHiddenAncestors = memoize(
2828
ancestors.push(vNode);
2929
}
3030
} else {
31-
if (overflow.includes('hidden')) {
31+
if (overflow === 'hidden' || overflow.includes('clip')) {
3232
ancestors.push(vNode);
3333
}
3434
}

lib/core/base/rule.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from '../utils';
1313
import { isVisibleToScreenReaders } from '../../commons/dom';
1414
import constants from '../constants';
15+
import cache from './cache';
1516

1617
export default function Rule(spec, parentAudit) {
1718
this._audit = parentAudit;
@@ -245,6 +246,7 @@ Rule.prototype.run = function run(context, options = {}, resolve, reject) {
245246
try {
246247
// Matches throws an error when it lacks support for document methods
247248
nodes = this.gatherAndMatchNodes(context, options);
249+
cache.set(this.id, nodes.length);
248250
} catch (error) {
249251
// Exit the rule execution if matches fails
250252
reject(new SupportError({ cause: error, ruleId: this.id }));

0 commit comments

Comments
 (0)