pull/8167/head
Simon H 4 years ago committed by GitHub
parent fec414c8ea
commit 43980d528d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -607,10 +607,10 @@ export default class Element extends Node {
component.warn(this, compiler_warnings.a11y_no_interactive_element_to_noninteractive_role(current_role, this.name)); component.warn(this, compiler_warnings.a11y_no_interactive_element_to_noninteractive_role(current_role, this.name));
} }
// no-noninteractive-element-to-interactive-role // no-noninteractive-element-to-interactive-role
if (is_non_interactive_element(this.name, attribute_map) && is_interactive_roles(current_role)) { if (is_non_interactive_element(this.name, attribute_map) && is_interactive_roles(current_role)) {
component.warn(this, compiler_warnings.a11y_no_noninteractive_element_to_interactive_role(current_role, this.name)); component.warn(this, compiler_warnings.a11y_no_noninteractive_element_to_interactive_role(current_role, this.name));
} }
}); });
} }
} }

@ -129,16 +129,16 @@ function match_schema(
} }
export enum ElementInteractivity { export enum ElementInteractivity {
Interactive = 'interactive', Interactive = 'interactive',
NonInteractive = 'non-interactive', NonInteractive = 'non-interactive',
Static = 'static', Static = 'static',
} }
export function element_interactivity( export function element_interactivity(
tag_name: string, tag_name: string,
attribute_map: Map<string, Attribute> attribute_map: Map<string, Attribute>
): ElementInteractivity { ): ElementInteractivity {
if ( if (
interactive_element_role_schemas.some((schema) => interactive_element_role_schemas.some((schema) =>
match_schema(schema, tag_name, attribute_map) match_schema(schema, tag_name, attribute_map)
) )
@ -146,7 +146,7 @@ export function element_interactivity(
return ElementInteractivity.Interactive; return ElementInteractivity.Interactive;
} }
if ( if (
tag_name !== 'header' && tag_name !== 'header' &&
non_interactive_element_role_schemas.some((schema) => non_interactive_element_role_schemas.some((schema) =>
match_schema(schema, tag_name, attribute_map) match_schema(schema, tag_name, attribute_map)
@ -155,7 +155,7 @@ export function element_interactivity(
return ElementInteractivity.NonInteractive; return ElementInteractivity.NonInteractive;
} }
if ( if (
interactive_element_ax_object_schemas.some((schema) => interactive_element_ax_object_schemas.some((schema) =>
match_schema(schema, tag_name, attribute_map) match_schema(schema, tag_name, attribute_map)
) )
@ -163,7 +163,7 @@ export function element_interactivity(
return ElementInteractivity.Interactive; return ElementInteractivity.Interactive;
} }
if ( if (
non_interactive_element_ax_object_schemas.some((schema) => non_interactive_element_ax_object_schemas.some((schema) =>
match_schema(schema, tag_name, attribute_map) match_schema(schema, tag_name, attribute_map)
) )
@ -171,19 +171,19 @@ export function element_interactivity(
return ElementInteractivity.NonInteractive; return ElementInteractivity.NonInteractive;
} }
return ElementInteractivity.Static; return ElementInteractivity.Static;
} }
export function is_interactive_element(tag_name: string, attribute_map: Map<string, Attribute>): boolean { export function is_interactive_element(tag_name: string, attribute_map: Map<string, Attribute>): boolean {
return element_interactivity(tag_name, attribute_map) === ElementInteractivity.Interactive; return element_interactivity(tag_name, attribute_map) === ElementInteractivity.Interactive;
} }
export function is_non_interactive_element(tag_name: string, attribute_map: Map<string, Attribute>): boolean { export function is_non_interactive_element(tag_name: string, attribute_map: Map<string, Attribute>): boolean {
return element_interactivity(tag_name, attribute_map) === ElementInteractivity.NonInteractive; return element_interactivity(tag_name, attribute_map) === ElementInteractivity.NonInteractive;
} }
export function is_static_element(tag_name: string, attribute_map: Map<string, Attribute>): boolean { export function is_static_element(tag_name: string, attribute_map: Map<string, Attribute>): boolean {
return element_interactivity(tag_name, attribute_map) === ElementInteractivity.Static; return element_interactivity(tag_name, attribute_map) === ElementInteractivity.Static;
} }
export function is_semantic_role_element(role: ARIARoleDefinitionKey, tag_name: string, attribute_map: Map<string, Attribute>) { export function is_semantic_role_element(role: ARIARoleDefinitionKey, tag_name: string, attribute_map: Map<string, Attribute>) {

Loading…
Cancel
Save