Skip to content

Commit 1cb8715

Browse files
committed
Improve presentation/none check to be case-insensitive
Per WAI-ARIA 1.2 spec: "Case-sensitivity of the comparison inherits from the case-sensitivity of the host language" — and HTML is case-insensitive. This improves on the original ember-template-lint which inconsistently uses case-insensitive matching for VALID_ROLES but case-sensitive for the presentation/none check. Ref: https://www.w3.org/TR/wai-aria-1.2/#document-handling_author-errors_roles
1 parent f5b445d commit 1cb8715

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/rules/template-no-invalid-role.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ module.exports = {
242242
return;
243243
}
244244

245-
// Check for presentation/none role on semantic elements
245+
// Check for presentation/none role on semantic elements (case-insensitive per WAI-ARIA 1.2:
246+
// "Case-sensitivity of the comparison inherits from the case-sensitivity of the host language"
247+
// and HTML is case-insensitive — https://www.w3.org/TR/wai-aria-1.2/#document-handling_author-errors_roles)
246248
if (
247249
(roleLower === 'presentation' || roleLower === 'none') &&
248250
SEMANTIC_ELEMENTS.has(node.tag)

0 commit comments

Comments
 (0)