-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: derive INTERACTIVE_ROLES from aria-query taxonomy (+ widen menu-pattern exception) #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
74dc09a
e739c0d
33c426b
d1a328e
02516ec
9896115
c0fad74
fcab7e1
d0faebb
ebdc2c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| 'use strict'; | ||
|
|
||
| const { isNativeElement } = require('../utils/is-native-element'); | ||
| const { isHtmlInteractiveContent } = require('../utils/html-interactive-content'); | ||
| const { INTERACTIVE_ROLES } = require('../utils/interactive-roles'); | ||
|
|
||
| function hasAttr(node, name) { | ||
|
|
@@ -78,6 +77,20 @@ | |
| const ignoreTabindex = options.ignoreTabindex || false; | ||
| const ignoreUsemap = options.ignoreUsemap || false; | ||
|
|
||
| const NATIVE_INTERACTIVE_ELEMENTS = new Set([ | ||
| 'button', | ||
| 'canvas', | ||
| 'details', | ||
| 'embed', | ||
| 'iframe', | ||
| 'input', | ||
| 'label', | ||
| 'select', | ||
| 'summary', | ||
| 'textarea', | ||
| ]); | ||
|
|
||
| // eslint-disable-next-line complexity | ||
| function isInteractive(node) { | ||
| const tag = node.tag?.toLowerCase(); | ||
| if (!tag) { | ||
|
|
@@ -91,7 +104,7 @@ | |
| // HTML §3.2.5.2.7 interactive content (authoritative for content-model; | ||
| // handles label/button/etc. + conditional a[href], input[!hidden], | ||
| // img[usemap], audio/video[controls]). | ||
| if (isHtmlInteractiveContent(node, getTextAttr, { ignoreUsemap })) { | ||
|
Check failure on line 107 in lib/rules/template-no-invalid-interactive.js
|
||
| return true; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.