|
|
@ -24,7 +24,7 @@ import { Literal } from 'estree';
|
|
|
|
import compiler_warnings from '../compiler_warnings';
|
|
|
|
import compiler_warnings from '../compiler_warnings';
|
|
|
|
import compiler_errors from '../compiler_errors';
|
|
|
|
import compiler_errors from '../compiler_errors';
|
|
|
|
import { ARIARoleDefintionKey, roles, aria, ARIAPropertyDefinition, ARIAProperty } from 'aria-query';
|
|
|
|
import { ARIARoleDefintionKey, roles, aria, ARIAPropertyDefinition, ARIAProperty } from 'aria-query';
|
|
|
|
import { is_interactive_element, is_non_interactive_roles, is_presentation_role, is_interactive_roles, is_hidden_from_screen_reader } from '../utils/a11y';
|
|
|
|
import { is_interactive_element, is_non_interactive_roles, is_presentation_role, is_interactive_roles, is_hidden_from_screen_reader, is_semantic_role_element } from '../utils/a11y';
|
|
|
|
|
|
|
|
|
|
|
|
const aria_attributes = 'activedescendant atomic autocomplete busy checked colcount colindex colspan controls current describedby description details disabled dropeffect errormessage expanded flowto grabbed haspopup hidden invalid keyshortcuts label labelledby level live modal multiline multiselectable orientation owns placeholder posinset pressed readonly relevant required roledescription rowcount rowindex rowspan selected setsize sort valuemax valuemin valuenow valuetext'.split(' ');
|
|
|
|
const aria_attributes = 'activedescendant atomic autocomplete busy checked colcount colindex colspan controls current describedby description details disabled dropeffect errormessage expanded flowto grabbed haspopup hidden invalid keyshortcuts label labelledby level live modal multiline multiselectable orientation owns placeholder posinset pressed readonly relevant required roledescription rowcount rowindex rowspan selected setsize sort valuemax valuemin valuenow valuetext'.split(' ');
|
|
|
|
const aria_attribute_set = new Set(aria_attributes);
|
|
|
|
const aria_attribute_set = new Set(aria_attributes);
|
|
|
@ -514,6 +514,7 @@ export default class Element extends Node {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// role-has-required-aria-props
|
|
|
|
// role-has-required-aria-props
|
|
|
|
|
|
|
|
if (!is_semantic_role_element(value, this.name, attribute_map)) {
|
|
|
|
const role = roles.get(value);
|
|
|
|
const role = roles.get(value);
|
|
|
|
if (role) {
|
|
|
|
if (role) {
|
|
|
|
const required_role_props = Object.keys(role.requiredProps);
|
|
|
|
const required_role_props = Object.keys(role.requiredProps);
|
|
|
@ -523,6 +524,7 @@ export default class Element extends Node {
|
|
|
|
component.warn(attribute, compiler_warnings.a11y_role_has_required_aria_props(value as string, required_role_props));
|
|
|
|
component.warn(attribute, compiler_warnings.a11y_role_has_required_aria_props(value as string, required_role_props));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// no-interactive-element-to-noninteractive-role
|
|
|
|
// no-interactive-element-to-noninteractive-role
|
|
|
|
if (is_interactive_element(this.name, attribute_map) && (is_non_interactive_roles(value) || is_presentation_role(value))) {
|
|
|
|
if (is_interactive_element(this.name, attribute_map) && (is_non_interactive_roles(value) || is_presentation_role(value))) {
|
|
|
|