diff --git a/lib/commons/aria/is-accessible-ref.js b/lib/commons/aria/is-accessible-ref.js index 8c1e0a6765..62403760ea 100644 --- a/lib/commons/aria/is-accessible-ref.js +++ b/lib/commons/aria/is-accessible-ref.js @@ -35,8 +35,8 @@ aria.isAccessibleRef = function isAccessibleRef(node) { // because axe.commons is not available in axe.utils, we can't do // this caching when we build up the virtual tree - if (!axe._cache.idRefsCached) { - axe._cache.idRefsCached = true; + if (!axe._cache.idRefs) { + axe._cache.idRefs = {}; // Get all idref(s) attributes on the lookup table const refAttrs = Object.keys(aria.lookupTable.attributes).filter(attr => { const { type } = aria.lookupTable.attributes[attr]; diff --git a/lib/core/public/run-rules.js b/lib/core/public/run-rules.js index 6004ae96ae..d740531371 100644 --- a/lib/core/public/run-rules.js +++ b/lib/core/public/run-rules.js @@ -20,9 +20,7 @@ function runRules(context, options, resolve, reject) { 'use strict'; try { axe._cache = { - nodeMap: new WeakMap(), - idRefs: {}, - idRefsCached: false + nodeMap: new WeakMap() }; context = new Context(context); diff --git a/test/testutils.js b/test/testutils.js index 29d6d7e304..6114340f3f 100644 --- a/test/testutils.js +++ b/test/testutils.js @@ -90,11 +90,6 @@ testUtils.fixtureSetup = function(content) { fixture.appendChild(node); }); } - axe._cache = { - nodeMap: new WeakMap(), - idRefs: {}, - idRefsCached: false - }; axe._tree = axe.utils.getFlattenedTree(fixture); axe._selectorData = axe.utils.getSelectorData(axe._tree); @@ -305,8 +300,6 @@ axe.testUtils = testUtils; beforeEach(function() { axe._cache = { - nodeMap: new WeakMap(), - idRefs: {}, - idRefsCached: false + nodeMap: new WeakMap() }; });