diff --git a/lib/rules/template-no-nested-landmark.js b/lib/rules/template-no-nested-landmark.js index 1bdbdd11b3..9e516d9ccc 100644 --- a/lib/rules/template-no-nested-landmark.js +++ b/lib/rules/template-no-nested-landmark.js @@ -5,11 +5,10 @@ const LANDMARK_ROLES = new Set([ 'form', 'main', 'navigation', - 'region', 'search', ]); -const LANDMARK_ELEMENTS = new Set(['header', 'aside', 'footer', 'form', 'main', 'nav', 'section']); +const LANDMARK_ELEMENTS = new Set(['header', 'aside', 'footer', 'form', 'main', 'nav']); const EQUIVALENT_ROLE = { aside: 'complementary', diff --git a/tests/lib/rules/template-no-nested-landmark.js b/tests/lib/rules/template-no-nested-landmark.js index 03aca0099a..0b99cbe0a1 100644 --- a/tests/lib/rules/template-no-nested-landmark.js +++ b/tests/lib/rules/template-no-nested-landmark.js @@ -42,6 +42,15 @@ ruleTester.run('template-no-nested-landmark', rule, { '', '', '', + + // `
` only gets the `region` landmark role when it has an accessible name + // (aria-label/aria-labelledby/title). Without one it has the generic role — see + // https://www.w3.org/TR/html-aam-1.0/#el-section + // This rule does not inspect accessible names, so unnamed sections are excluded. + '', + // `role="region"` is the landmark role a named `
` gets. Nesting it is + // excluded for the same reason: the rule cannot verify an accessible name is present. + '', ], invalid: [