Skip to content

Commit 49c223f

Browse files
committed
Reverted to cache method
1 parent ace6841 commit 49c223f

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

lib/commons/dom/get-element-stack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import createGrid from './create-grid';
99
* @param {Node} node
1010
* @return {Node[]}
1111
*/
12-
function getElementStack(node, isCoordsPassed = false, x, y) {
12+
function getElementStack(node, isCoordsPassed = false, x = null, y = null) {
1313
createGrid();
1414

1515
const vNode = getNodeFromTree(node);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ const getOverflowHiddenAncestors = memoize(
1818

1919
const overflow = vNode.getComputedStylePropertyValue('overflow');
2020

21-
if (cache.get('200%ZoomRule')) {
21+
if (
22+
cache.get('ruleId') &&
23+
cache.get('ruleId') === 'zoom-text-overlap-viewport'
24+
) {
2225
if (
2326
overflow.includes('hidden') ||
2427
overflow.includes('clip') ||

lib/commons/dom/get-visible-child-text-rects.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,18 @@ const getVisibleChildTextRects = memoize(
2424
}
2525

2626
const contentRects = getContentRects(textNode);
27-
if (
28-
isOutsideNodeBounds(contentRects, nodeRect) &&
29-
!cache.get('200%ZoomRule')
30-
) {
27+
if (isOutsideNodeBounds(contentRects, nodeRect) && !cache.get('ruleId')) {
3128
return;
3229
}
3330

3431
clientRects.push(...filterHiddenRects(contentRects, overflowHiddenNodes));
3532
});
3633

37-
if (clientRects.length <= 0 && cache.get('200%ZoomRule')) {
34+
if (
35+
clientRects.length <= 0 &&
36+
cache.get('ruleId') &&
37+
cache.get('ruleId') === 'zoom-text-overlap-viewport'
38+
) {
3839
return [];
3940
}
4041
/**
@@ -51,7 +52,6 @@ const getVisibleChildTextRects = memoize(
5152
*
5253
* @see https://github.com/dequelabs/axe-core/issues/4253
5354
*/
54-
5555
return clientRects.length
5656
? clientRects
5757
: filterHiddenRects([nodeRect], overflowHiddenNodes);

0 commit comments

Comments
 (0)