Skip to content

Commit 2f96a82

Browse files
committed
chore: replace 'per upstream' comments with MDN-sourced rationale
1 parent 958884b commit 2f96a82

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/lib/rules/template-no-nested-landmark.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ ruleTester.run('template-no-nested-landmark', rule, {
4343
'<template><header><div role="navigation"></div></header></template>',
4444
'<template><div role="banner"><div role="navigation"></div></div></template>',
4545

46-
// `<section>` is not a landmark element per upstream, so nested sections are allowed.
46+
// `<section>` only gets the `region` landmark role when it has an accessible name
47+
// (aria-label/aria-labelledby/title). Without one it has the generic role — see
48+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/section.
49+
// This rule does not inspect accessible names, so unnamed sections are excluded.
4750
'<template><section><section>Content</section></section></template>',
48-
// `role="region"` is not a landmark role per upstream, so nested regions are allowed.
51+
// `role="region"` is the landmark role a named `<section>` gets. Nesting it is
52+
// excluded for the same reason: the rule cannot verify an accessible name is present.
4953
'<template><div role="region"><div role="region">Content</div></div></template>',
5054
],
5155

0 commit comments

Comments
 (0)