diff --git a/lib/commons/dom/get-overflow-hidden-ancestors.js b/lib/commons/dom/get-overflow-hidden-ancestors.js index 79ca04ce..8ace4290 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' || overflow.includes('clip')) { ancestors.push(vNode); } } 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 }));