MCPcopy Create free account
hub / github.com/InverseUI/InverseUI-Recorder / getAriaRole

Function getAriaRole

util/playwright_selector.js:152–163  ·  view source on GitHub ↗

* Get ARIA role (explicit or implicit) - from roleUtils.ts lines 281-291

(element)

Source from the content-addressed store, hash-verified

150 * Get ARIA role (explicit or implicit) - from roleUtils.ts lines 281-291
151 */
152function getAriaRole(element) {
153 const explicitRole = getExplicitAriaRole(element);
154 if (!explicitRole)
155 return getImplicitAriaRole(element);
156 if (explicitRole === 'none' || explicitRole === 'presentation') {
157 const implicitRole = getImplicitAriaRole(element);
158 // Presentation conflict resolution
159 if (element.hasAttribute('aria-label') || element.hasAttribute('aria-labelledby'))
160 return implicitRole;
161 }
162 return explicitRole;
163}
164
165/**
166 * Normalize whitespace in text (from stringUtils)

Callers 3

getElementAccessibleNameFunction · 0.85
countMatchingElementsFunction · 0.85
buildCandidatesFunction · 0.85

Calls 2

getExplicitAriaRoleFunction · 0.85
getImplicitAriaRoleFunction · 0.85

Tested by

no test coverage detected