Gecko object attributes

« AT APIs Support Page

Introduction

You can obtain object attributes by nsIAccessible.getAttributes() method. Object attributes are relevant for the entire subtree of the object they are on, unless they are overridden by a descendent with the same object attribute. This is in contrast to text attributes, which apply only to substrings in a text object.

Object Attributes List

ARIA attributes

All ARIA attributes used on DOM element (i.e., any attribute prefixed by 'aria-') are exposed as object attributes; name is preserved except the 'aria-' prefix is cut.

Common attributes

class
The class name for an element from HTML, XUL, SVG, etc. This is useful for retrieving Microformat semantics for an element.
display
Similar with display CSS style.
Applied to: any visible accessible
id
Any value, defined by UI/content developers. Used to indicate a persistent identifier for any object; useful for scripting.
Applied to: any role which related DOM node has ID attribute
tag
The actual markup tag used to create this element (also used in XUL).
Applied to: any role
xml-roles
If a dynamic content accessibility role string is used, it is exposed here. This may provide more information than the mapped role, which is best-fit. The role string may be a space-delimited list of roles.
Applied to: any role

Group attributes

level
For headings, the heading level. For outline items, the indentation level. For diagrams with levels, each item can have its level specified. The level value is 1-based.
Applied to: grid, heading, listitem, row, tablist
Exposed in ARIA: aria-level
posinset
If this item is in a group, what is the item number within the group, where the size is defined by the setsize attribute. The first item should have posinset="1", and the last item should have a posinset value equal to the setsize.
Applied to: listitem, option
Exposed in ARIA: aria-posinset
setsize
If this item is in a group, this indicates the number of items in the group. This is useful when combined with the posinset object attribute.
Applied to: listitem, option
Exposed in ARIA: aria-setsize

Live region attribues

atomic
true when the entire region should be presented as a whole, when changes within it are considered important enough to automatically present.
Applied to: any role
Exposed via ARIA: aria-atomic
live
A hint as to whether changes within the current region or subtree should be automatically presented. Possible values are "off" which is the same as not being set -- this means the region is not live. Other possible values are "polite", "assertive", and "rude", which is a suggestion for the policy when interrupting the user for changes to this region. Please see the ARIA States and Properties module for more information. Additional information may be provide by the object attributes atomic and relevant.
Applied to: any role
Exposed in ARIA: aria-live
relevant
Space delimited string with keywords describing what kinds of changes in the subtree are informational, as opposed to presentational. If not specified, the default should be considered "additions text", which indicates that newly created objects and changes to text and text equivalents should be considered relevant, and that the hiding or removal of items is not. Please see the ARIA States and Properties module for more information.
Exposed in ARIA: aria-relevant
container-atomic
Is this change inside a region that should always be presented at once. If yes, member-of relation will point to the root of the region. See the Live Region Support for more information.
container-busy
The current changes are not yet complete. A state change event for the A11y API's BUSY state will be fired on the container object currently marked as BUSY, once it is no longer BUSY. This is especially important in atomic regions. The entire atomic region should be presented once when it is finally no longer BUSY. See the Live Region Support for more information.
container-live
Interruption policy. See the Live Region Support for more information.
container-live-role
Indicates the role for the live region that contains the current accessible object.
container-relevant
What types of mutations are possibly relevant? See the Live Region Support for more information.
event-from-input
Was the root cause of this event explicit user input? See the Live Region Support for more information.
member-of
Points to the root of the atomic container that this object is in. This will always be an ancestor of the current object. See the Live Region Support for more information.

Common widget attributes

checkable
true when the widget is known to behave like a checkbox. Note some widgets which appear to be checkboxes might in fact be cyclers (see "cycles" below). Action 0 is named either "check" or "uncheck".
Applied to: STATE_CHECKABLE state
datatype
WARNING: obsolete, do not use! A qname that refers to an XSD (schema) defined type. For example, a datatype may be xsd:integer. When this is not specified, the default is string, unless the Value interface is exposed, which indicates the type is numeric. For more information please read about schema datatypes.
Applied to: any widget that accepts input
Exposed via ARIA: aria-datatype
Exposed in XForms: from boud instance node datatype
draggable
true when the accessible object can be grabbed.
dropeffect
Indicates what functions can be performed when the dragged object is released on the drop target. Refer to aria-dropeffect for the list of possible values.
grabbed
true when the accessible object has been selected for dragging.
haspopup
true when the object displays a pop-up menu or window when invoked.
Applied to: STATE_HASPOPUP
Exposed in ARIA: aria-haspopup
Note: this is only supported on ATK/AT-SPI. On MSAA, STATE_SYSTEM_HASPOPUP is used.
sort
if "ascending" or "descending", then child items within the container are currently sorted as indicated.
Applied to: any container
Exposed in ARIA: aria-sort
src
src attribute is placed on HTML image element.
Applied to: ROLE_GRAPHIC for the <html:img/> element.
cycles
"true" when the tree cell is a cycler, which means each click will cycle to the next option. In this case action 0 is called "cycles", which moves to the next option in the same way a manual click does.
Applied to: ROLE_CELL for the <xul:tree/>
Note: it's not exposed currently
layout-guess
true when Gecko's heuristic determines that it is a table that is probably used for layout, not for table.
Value not set means it is probably a data table.
Applied to: ROLE_TABLE
table-cell-index
The index of the table cell accessible. Use nsIAccessibleTable and nsIAccessibleTableCell instead.
Applied to ROLE_CELL

Hypertext attributes

formatting
"block" if the object uses block formatting, and thus starts on a new line and ends with a hard line break that is not visible in the actual text. For example, a heading, paragraph, or list item is typically formatted as a block, but there is no requirement to do so. Their formatting may have been changed with CSS. An example of this is often horizontal navigation bars with list items that are formatted with CSS display: inline.
Applied to: any object that supports the hypertext interface
Note: deprecated, use display attribute instead
line-number
The current line number of the caret, whether simply because the "browse with caret" option is on, or the caret used for editing text. The line number is relative to the top of the currently focused area (the document, a rich text editable area, or an input control).
Applied to: any focusable accessible text object
margin-bottom
Specifies how much vertical space there will be after the bottom of the last line of content in a text accessible (see the CSS margin-bottom property).
margin-left
Specifies how much horizontal space there will be before the beginning of each line of content in a text accessible (see the CSS margin-left property).
margin-right
Specifies how much horizontal space there will be after the end of each line of content in a text accessible (see the CSS margin-right property).
margin-top
Specifies how much vertical space there will be before the top of the first line of content in a text accessible (see the CSS margin-top property).
text-align
Specifies how lines of text are aligned with each other (see CSS text-align property).
text-indent
Specifies how much horizontal space should be left before beginning of the first line of the text content of an text accessible (see the CSS text-indent property).

Value attributes

valuetext
A text equivalent to the current value, such as "High" in a slider or "Unzipping files" in a progress meter.
Applied to: Anything that supports the value interface, especially a slider or progress meter

Document Tags and Contributors

 Last updated by: Fredchat,