The nsIAccessible interface is a cross-platform interface that supports platform-specific accessibility APIs like MSAA and ATK. Contains the sum of what's needed to support IAccessible as well as ATK's generic accessibility objects.
Can also be used by in-process accessibility clients to get information about objects in the accessible tree. The accessible tree is a subset of nodes in the DOM tree -- such as documents, focusable elements and text. Mozilla creates the implementations of nsIAccessible on demand.
[scriptable, uuid=(c7520419-87ec-42bc-98cc-04c0bf173530)]
interface nsIAccessible : nsISupports { ... };
This section provides short overview of methods and attributes of this interface. All methods and attributes are grouped by categories.
These includes main properties used to describe the accessible.
nsIAccessible.getState() to get states of the accessibeYou can navigate through the accessible tree by the following methods and attributes.
nsIAccessible.getChildAt(), nsIAccessible.childCount to navigate through the children by indexYou can use nsIAccessible.indexInParent to get accessible index in its parent. Use nsIAccessible.groupPosition() to get information about this accessible in its group.
Many accessibles are linked with each other, for example, if one accessible gives the accessible name for another accessible (for example, html:label and html control) then these accessibles are related, please refer to relations documentation for more information. You can get related accessibles by methods
nsIAccessible.getAccessibleRelated()nsIAccessible.getRelations()nsIAccessible.getRelation() and nsIAccessible.relationsCount.In order to focus an accessible or get focused child accessible use nsIAccessible.takeFocus() and nsIAccessible.focusedChild.
To select an accessible you can use nsIAccessible.setSelected(), nsIAccessible.takeSelection() and nsIAccessible.extendSelection().
You can prepare actions on some accessibles (for example on button accessible). The following methods are intended for this nsIAccessible.actionCount, nsIAccessible.getActionName(), nsIAccessible.getActionDescription() and nsIAccessible.doAction().
nsIAccessible.description and nsIAccessible.help provides additional text information about accessible.
Many accessibles exposes attributes to provide more details that cannot be fit into existing API methods, please refer to attributes documentation for more information. You can use nsIAccessible.attributes to get a map of attributes.
Some actions on accessibles can be performed by keyboard shortcuts. Following methods are used to get them nsIAccessible.defaultKeyBinding(), nsIAccessible.getKeyBindings(), nsIAccessible.keyboardShortcut.
You can use nsIAccessible.getBounds() to get size and coordinates of the accessible.
nsIAccessible.getChildAtPoint() to get child accessible from pointnsIAccessible.getAccessibleToLeft(), nsIAccessible.getAccessibleToRight(), nsIAccessible.getAccessibleAbove() or nsIAccessible.getAccessibleBelow() to get left, right, top or below placed accessiblegetKeyBindingsgetStategroupPositiongetChildAtPointgetChildAtgetAccessibleToRightgetAccessibleToLeftgetAccessibleAbovegetAccessibleBelowgetAccessibleRelatedgetRelationgetRelationsgetBoundssetSelectedextendSelectiontakeSelectiontakeFocusgetActionNamegetActionDescriptiondoAction0 is the default action.parentnextSiblingpreviousSiblingfirstChildlastChildchildrenchildCountindexInParent-1 if this accessible does not have a parent.namevaluedescriptionkeyboardShortcutalt+letter, or just the letter alone for menu items.defaultKeyBindingCtrl+O for Open file.rolehelpfocusedChildattributesrelationsCountnumActions