goog.a11y.aria
Functions
assertRoleIsSetInternalUtil( element, allowedRoles ) → void
void
Asserts that the element has a role set if it's not an HTML element whose semantics is well supported by most screen readers. Only to be used internally by the ARIA library in goog.a11y.aria.*.
Parameters |
|
---|
getActiveDescendant( element ) → (Element|null)
(Element|null)
Returns the activedescendant element for the input element by using the activedescendant ARIA property of the given element.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getLabel( element ) → string
string
Gets the label of the given element.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getRole( element ) → (goog.a11y.aria.Role|null)
(goog.a11y.aria.Role|null)
Gets role of an element.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getState( element, stateName ) → string
string
getStateBoolean( element, stateName ) → (boolean|null)
(boolean|null)
getStateNumber( element, stateName ) → (number|null)
(number|null)
getStateString( element, stateName ) → (string|null)
(string|null)
getStringArrayStateInternalUtil( element, stateName ) → IArrayLike<string>
IArrayLike<string>
Gets array of strings value of the specified state or property for the element. Only to be used internally by the ARIA library in goog.a11y.aria.*.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
hasState( element, stateName ) → boolean
boolean
isContainerRole( element ) → boolean
boolean
Returns whether the element has a container ARIA role.
Container roles are ARIA roles that use the aria-activedescendant property
to manage their active descendants or children. See
#aria-activedescendant
for more information.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
removeRole( element ) → void
void
Removes role of an element.
Parameters |
|
---|
removeState( element, stateName ) → void
void
Remove the state or property for the element.
Parameters |
|
---|
setActiveDescendant( element, activeElement ) → void
void
Sets the activedescendant ARIA property value for an element. If the activeElement is not null, it should have an id set.
Parameters |
|
---|
setLabel( element, label ) → void
void
Sets the label of the given element.
Parameters |
|
---|
setRole( element, roleName ) → void
void
Sets the role of an element. If the roleName is empty string or null, the role for the element is removed. We encourage clients to call the goog.a11y.aria.removeRole method instead of setting null and empty string values. Special handling for this case is added to ensure backword compatibility with existing code.
Parameters |
|
---|
setState( element, stateName, value ) → void
void
Sets the state or property of an element.
Parameters |
|
---|
toggleState( el, attr ) → void
void
Toggles the ARIA attribute of an element. Meant for attributes with a true/false value, but works with any attribute. If the attribute does not have a true/false value, the following rules apply: A not empty attribute will be removed. An empty attribute will be set to true.
Parameters |
|
---|