Home / Function/ is_semantic_role_element() — astro Function Reference

is_semantic_role_element() — astro Function Reference

Architecture documentation for the is_semantic_role_element() function in a11y.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  a66a8388_866c_3b9b_c73a_5a4e79de032c["is_semantic_role_element()"]
  7c3b1f35_d834_f912_339d_8627bdd8631a["a11y.ts"]
  a66a8388_866c_3b9b_c73a_5a4e79de032c -->|defined in| 7c3b1f35_d834_f912_339d_8627bdd8631a
  style a66a8388_866c_3b9b_c73a_5a4e79de032c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts lines 685–709

function is_semantic_role_element(
	role: ARIARoleDefinitionKey,
	tag_name: string,
	attributes: Record<string, string>,
) {
	for (const [schema, ax_object] of elementAXObjects.entries()) {
		if (
			schema.name === tag_name &&
			(!schema.attributes ||
				schema.attributes.every((attr: any) => attributes[attr.name] === attr.value))
		) {
			for (const name of ax_object) {
				const axRoles = AXObjectRoles.get(name);
				if (axRoles) {
					for (const { name: _name } of axRoles) {
						if (_name === role) {
							return true;
						}
					}
				}
			}
		}
	}
	return false;
}

Domain

Subdomains

Frequently Asked Questions

What does is_semantic_role_element() do?
is_semantic_role_element() is a function in the astro codebase, defined in packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts.
Where is is_semantic_role_element() defined?
is_semantic_role_element() is defined in packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts at line 685.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free