aria.js
No description.

File Location

/goog/a11y/aria/aria.js


Public Protected Private

Global Functions

goog.a11y.aria.assertRoleIsSetInternalUtil(elementallowedRoles)
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.*.
Arguments:
element : !Element
The element to assert an ARIA role set.
allowedRoles : !goog.array.ArrayLike.<string>
The child roles of the roles.
code »
goog.a11y.aria.getActiveDescendant(element) ?Element
Returns the activedescendant element for the input element by using the activedescendant ARIA property of the given element.
Arguments:
element : !Element
DOM node to get activedescendant element for.
Returns: ?Element  DOM node of the activedescendant, if found.
code »
goog.a11y.aria.getAriaAttributeName_(ariaName) string
Adds the 'aria-' prefix to ariaName.
Arguments:
ariaName : string
ARIA state/property name.
Returns: string  The ARIA attribute name with added 'aria-' prefix.
code »
goog.a11y.aria.getLabel(element) string
Gets the label of the given element.
Arguments:
element : !Element
DOM node to get label from.
Returns: string  label The label.
code »
goog.a11y.aria.getRole(element) !goog.a11y.aria.Role
Gets role of an element.
Arguments:
element : !Element
DOM element to get role of.
Returns: !goog.a11y.aria.Role  ARIA Role name.
code »
goog.a11y.aria.getState(elementstateName) string
Gets value of specified state or property.
Arguments:
element : !Element
DOM node to get state from.
stateName : !goog.a11y.aria.State | string
State name.
Returns: string  Value of the state attribute.
code »
goog.a11y.aria.getStateBoolean(elementstateName) ?boolean
Gets the boolean value of an ARIA state/property.
Arguments:
element : !Element
The element to get the ARIA state for.
stateName : !goog.a11y.aria.State | string
the ARIA state name.
Returns: ?boolean  Boolean value for the ARIA state value or null if the state value is not 'true', not 'false', or not set.
code »
goog.a11y.aria.getStateNumber(elementstateName) ?number
Gets the number value of an ARIA state/property.
Arguments:
element : !Element
The element to get the ARIA state for.
stateName : !goog.a11y.aria.State | string
the ARIA state name.
Returns: ?number  Number value for the ARIA state value or null if the state value is not a number or not set.
code »
goog.a11y.aria.getStateString(elementstateName) ?string
Gets the string value of an ARIA state/property.
Arguments:
element : !Element
The element to get the ARIA state for.
stateName : !goog.a11y.aria.State | string
the ARIA state name.
Returns: ?string  String value for the ARIA state value or null if the state value is empty string or not set.
code »
goog.a11y.aria.getStringArrayStateInternalUtil(elementstateName) !goog.array.ArrayLike.<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.*.
Arguments:
element : !Element
DOM node to get state from.
stateName : !goog.a11y.aria.State
State name.
Returns: !goog.array.ArrayLike.<string>  string Array value of the state attribute.
code »
goog.a11y.aria.removeRole(element)
Removes role of an element.
Arguments:
element : !Element
DOM element to remove the role from.
code »
goog.a11y.aria.removeState(elementstateName)
Remove the state or property for the element.
Arguments:
element : !Element
DOM node where we set state.
stateName : !goog.a11y.aria.State
State name.
code »
goog.a11y.aria.setActiveDescendant(elementactiveElement)
Sets the activedescendant ARIA property value for an element. If the activeElement is not null, it should have an id set.
Arguments:
element : !Element
DOM node to set activedescendant ARIA property to.
activeElement : ?Element
DOM node being set as activedescendant.
code »
goog.a11y.aria.setLabel(elementlabel)
Sets the label of the given element.
Arguments:
element : !Element
DOM node to set label to.
label : string
The label to set.
code »
goog.a11y.aria.setRole(elementroleName)
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.
Arguments:
element : !Element
DOM node to set role of.
roleName : !goog.a11y.aria.Role | string
role name(s).
code »
goog.a11y.aria.setState(elementstateNamevalue)
Sets the state or property of an element.
Arguments:
element : !Element
DOM node where we set state.
stateName : !(goog.a11y.aria.State | string)
State attribute being set. Automatically adds prefix 'aria-' to the state name if the attribute is not an extra attribute.
value : string | boolean | number | !goog.array.ArrayLike.<string>
Value for the state attribute.
code »
goog.a11y.aria.splitStringOnWhitespace_(stringValue) !goog.array.ArrayLike.<string>
Splits the input stringValue on whitespace.
Arguments:
stringValue : string
The value of the string to split.
Returns: !goog.array.ArrayLike.<string>  string Array value as result of the split.
code »

Directory aria

File Reference