From c6e07bec43ef1935f2afb9429e9f12a937c38f14 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Wed, 26 Jul 2023 08:57:12 -0600 Subject: [PATCH] feat(page-no-duplicate-banner/contentinfo): deprecate options.nativeScopeFilter, take into ancestors with sectioning roles (#4105) * fix(page-no-duplicate-banner/contentinfo): take into account elements which have ancestors with sectioning roles * integration tests --- .../generic/page-no-duplicate-evaluate.js | 6 + .../keyboard/page-no-duplicate-banner.json | 2 +- .../page-no-duplicate-contentinfo.json | 2 +- test/checks/keyboard/page-no-duplicate.js | 179 ++++++++++++------ .../frames/level1.html | 15 ++ .../frames/level1.html | 15 ++ 6 files changed, 164 insertions(+), 55 deletions(-) diff --git a/lib/checks/generic/page-no-duplicate-evaluate.js b/lib/checks/generic/page-no-duplicate-evaluate.js index 3521a44952..1ce7130035 100644 --- a/lib/checks/generic/page-no-duplicate-evaluate.js +++ b/lib/checks/generic/page-no-duplicate-evaluate.js @@ -1,6 +1,7 @@ import cache from '../../core/base/cache'; import { querySelectorAllFilter } from '../../core/utils'; import { isVisibleToScreenReaders, findUpVirtual } from '../../commons/dom'; +import { getRole } from '../../commons/aria'; function pageNoDuplicateEvaluate(node, options, virtualNode) { if (!options || !options.selector || typeof options.selector !== 'string') { @@ -21,6 +22,7 @@ function pageNoDuplicateEvaluate(node, options, virtualNode) { isVisibleToScreenReaders(elm) ); + // @deprecated options.nativeScopeFilter // Filter elements that, within certain contexts, don't map their role. // e.g. a