Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 297198 of Gecko object attributes

  • Revision slug: Accessibility/AT-APIs/Gecko/Attrs
  • Revision title: Gecko object attributes
  • Revision id: 297198
  • Created:
  • Creator: Surkov.alexander
  • Is current revision? No
  • Comment

Revision Content

 

{{ BackToPage("Accessibility:AT-APIs#Supported_Object_Attributes", "AT APIs Support") }}

Introduction

You can obtain object attributes by {{ Interface-method("nsIAccessible", "getAttributes") }} method. Object attributes are relevant for the entire subtree of the object they are on, unless they are overridden by a descendant 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 persistant 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: {{ ARIAState("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: {{ ARIAState("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: {{ ARIAState("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: {{ ARIAState("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: {{ ARIAState("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: {{ ARIAState("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: {{ A11yStateRef("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: {{ ARIAState("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: {{ A11yStateRef("STATE_HASPOPUP") }}
Exposed in ARIA: {{ ARIAState("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: {{ ARIAState("sort") }}
src
src attribute is placed on HTML image element
 
Applied to: {{ A11yRoleRef("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: {{ A11yRoleRef("ROLE_CELL") }} for the <xul:{{ XULElem("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: {{ A11yRoleRef("ROLE_TABLE") }}
table-cell-index {{ Deprecated_inline() }}
The index of the table cell accessible. Use {{ Interface("nsIAccessibleTable") }} and {{ Interface("nsIAccessibleTableCell") }} instead.
Applied to {{ A11yRoleRef("ROLE_CELL") }}

Hypertext attributes

formatting {{ Deprecated_inline() }}
"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 are typically formatted as a block, but there is no requirement that they 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 {{ gecko_minversion_inline("13.0") }}
Specifies how much vertical space there will be after the bottom of the last line of content in a text accessible (see the CSS {{ cssxref("margin-bottom") }} property).
margin-left {{ gecko_minversion_inline("13.0") }}
Specifies how much horizontal space there will be before the beginning of each line of content in a text accessible (see the CSS {{ cssxref("margin-left") }} property).
margin-right {{ gecko_minversion_inline("13.0") }}
Specifies how much horizontal space there will be after the end of each line of content in a text accessible (see the CSS {{ cssxref("margin-right") }} property).
margin-top {{ gecko_minversion_inline("13.0") }}
Specifies how much vertical space there will be before the top of the first line of content in a text accessible (see the CSS {{ cssxref("margin-top") }} property).
text-align
Specifies how lines of text are aligned with each other (see CSS {{ cssxref("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 {{ cssxref("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

Revision Source

<p>&nbsp;</p>
<p>{{ BackToPage("Accessibility:AT-APIs#Supported_Object_Attributes", "AT APIs Support") }}</p>
<h2 id="Introduction" name="Introduction">Introduction</h2>
<p>You can obtain object attributes by {{ Interface-method("nsIAccessible", "getAttributes") }} method. Object attributes are relevant for the entire subtree of the object they are on, unless they are overridden by a descendant with the same object attribute. This is in contrast to <a href="/en/Accessibility/AT-APIs/Gecko/TextAttrs/" title="https://developer.mozilla.org/en/Accessibility/AT-APIs/Gecko/TextAttrs/">text attributes</a>, which apply only to substrings in a text object.</p>
<h2 id="Object_Attributes_List" name="Object_Attributes_List">Object Attributes List</h2>
<h3 id="Common_attributes" name="Common_attributes">ARIA attributes</h3>
<p>All ARIA&nbsp;attributes used on DOM&nbsp;element (i.e. any attribute prefixed by 'aria-') are exposed as object attributes, name is preserved except the 'aria-' prefix is cut.</p>
<h3 id="Common_attributes" name="Common_attributes">Common attributes</h3>
<dl>
  <dt>
    class</dt>
  <dd>
    The class name for an element from HTML, XUL, SVG etc. This is useful for retrieving <a class="external" href="https://microformats.org/">Microformat</a> semantics for an element.</dd>
</dl>
<dl>
  <dt>
    display</dt>
  <dd>
    Similar with <code>display</code> CSS style.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: any visible accessible.</dd>
</dl>
<dl>
  <dt>
    id</dt>
  <dd>
    Any value, defined by UI/content developers. Used to indicate a persistant identifier for any object, useful for scripting</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: any role which related DOM node has ID attribute</dd>
</dl>
<dl>
  <dt>
    tag</dt>
  <dd>
    The actual markup tag used to create this element (also used in XUL)</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: any role</dd>
</dl>
<dl>
  <dt>
    xml-roles</dt>
  <dd>
    If a <a class="external" href="https://www.w3.org/WAI/intro/aria" title="https://www.w3.org/WAI/intro/aria">dynamic content accessibility</a> 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.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: any role</dd>
</dl>
<h3 id="Group_attributes" name="Group_attributes">Group attributes</h3>
<dl>
  <dt>
    level</dt>
  <dd>
    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.</dd>
  <dd>
    Applied to: grid, heading, listitem, row, tablist</dd>
  <dd>
    Exposed in ARIA: {{ ARIAState("level") }}</dd>
</dl>
<dl>
  <dt>
    posinset</dt>
  <dd>
    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.</dd>
  <dd>
    Applied to: listitem, option</dd>
  <dd>
    Exposed in ARIA: {{ ARIAState("posinset") }}</dd>
</dl>
<dl>
  <dt>
    setsize</dt>
  <dd>
    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.</dd>
  <dd>
    Applied to: listitem, option</dd>
  <dd>
    Exposed in ARIA: {{ ARIAState("setsize") }}</dd>
</dl>
<h3 id="Live_region_attribues" name="Live_region_attribues">Live region attribues</h3>
<dl>
  <dt>
    atomic</dt>
  <dd>
    <code>true</code> when the entire region should be presented as a whole, when changes within it are considered important enough to automatically present.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: any role</dd>
  <dd>
    Exposed via ARIA: {{ ARIAState("atomic") }}</dd>
</dl>
<dl>
  <dt>
    live</dt>
  <dd>
    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 <a class="external" href="https://www.w3.org/WAI/PF/Group/adaptable/">ARIA States and Properties module</a> for more information. Additional information may be provide by the object attributes atomic and relevant.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: any role</dd>
  <dd>
    Exposed in ARIA: {{ ARIAState("live") }}</dd>
</dl>
<dl>
  <dt>
    relevant</dt>
  <dd>
    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 <a class="external" href="https://www.w3.org/WAI/PF/Group/adaptable/">ARIA States and Properties module</a> for more information.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Exposed in ARIA: {{ ARIAState("relevant") }}</dd>
</dl>
<dl>
  <dt>
    container-atomic</dt>
  <dd>
    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 <a href="/en/AJAX/WAI_ARIA_Live_Regions//API_Support" title="en/AJAX/WAI_ARIA_Live_Regions//API_Support">Live Region Support</a> for more information.</dd>
</dl>
<dl>
  <dt>
    container-busy</dt>
  <dd>
    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 <a href="/en/AJAX/WAI_ARIA_Live_Regions//API_Support" title="en/AJAX/WAI_ARIA_Live_Regions//API_Support">Live Region Support</a> for more information.</dd>
</dl>
<dl>
  <dt>
    container-live</dt>
  <dd>
    Interruption policy. See the <a href="/en/AJAX/WAI_ARIA_Live_Regions//API_Support" title="en/AJAX/WAI_ARIA_Live_Regions//API_Support">Live Region Support</a> for more information.</dd>
</dl>
<dl>
  <dt>
    container-live-role</dt>
  <dd>
    Indicates the role for the live region that contains the current accessible object</dd>
</dl>
<dl>
  <dt>
    container-relevant</dt>
  <dd>
    What types of mutations are possibly relevant?. See the <a href="/en/AJAX/WAI_ARIA_Live_Regions//API_Support" title="en/AJAX/WAI_ARIA_Live_Regions//API_Support">Live Region Support</a> for more information.</dd>
</dl>
<dl>
  <dt>
    event-from-input</dt>
  <dd>
    Was the root cause of this event explicit user input?. See the <a href="/en/AJAX/WAI_ARIA_Live_Regions//API_Support" title="en/AJAX/WAI_ARIA_Live_Regions//API_Support">Live Region Support</a> for more information.</dd>
</dl>
<dl>
  <dt>
    member-of</dt>
  <dd>
    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 <a href="/en/AJAX/WAI_ARIA_Live_Regions//API_Support" title="en/AJAX/WAI_ARIA_Live_Regions//API_Support">Live Region Support</a> for more information.</dd>
</dl>
<h3 id="Common_widget_attributes" name="Common_widget_attributes">Common widget attributes</h3>
<dl>
  <dt>
    checkable</dt>
  <dd>
    <code>true</code> 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".</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: {{ A11yStateRef("STATE_CHECKABLE") }} state</dd>
</dl>
<dl>
  <dt>
    datatype</dt>
  <dd>
    WARNING:&nbsp;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 <a class="external" href="https://www.w3.org/TR/xmlschema-0/">schema datatypes</a>.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: any widget that accepts input</dd>
  <dd>
    Exposed via ARIA: {{ ARIAState("datatype") }}</dd>
  <dd>
    Exposed in XForms: from boud instance node datatype</dd>
</dl>
<dl>
  <dt>
    draggable</dt>
  <dd>
    <code>true</code> when the accessible object can be grabbed.</dd>
  <dd>
    &nbsp;</dd>
</dl>
<dl>
  <dt>
    dropeffect</dt>
  <dd>
    Indicates what functions can be performed when the dragged object is released on the drop target. Refer to <a href="https://www.w3.org/TR/wai-aria/states_and_properties#aria-dropeffect" title="https://www.w3.org/TR/wai-aria/states_and_properties#aria-dropeffect">aria-dropeffect</a> for the list of possible values.</dd>
  <dt>
    &nbsp;</dt>
  <dt>
    grabbed</dt>
  <dd>
    <code>true</code> when the accessible object has been selected for dragging.</dd>
  <dd>
    &nbsp;</dd>
</dl>
<dl>
  <dt>
    haspopup</dt>
  <dd>
    <code>true</code> when the object displays a pop-up menu or window when invoked.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: {{ A11yStateRef("STATE_HASPOPUP") }}</dd>
  <dd>
    Exposed in ARIA: {{ ARIAState("haspopup") }}</dd>
  <dd>
    Note: this is only supported on ATK/AT-SPI. On MSAA, STATE_SYSTEM_HASPOPUP is used.</dd>
</dl>
<dl>
  <dt>
    sort</dt>
  <dd>
    if "ascending" or "descending", then child items within the container are currently sorted as indicated.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: any container</dd>
  <dd>
    Exposed in ARIA: {{ ARIAState("sort") }}</dd>
</dl>
<h3 id="Image_related_attributes" name="Image_related_attributes">Image related attributes</h3>
<dl>
  <dt>
    src</dt>
  <dd>
    <code>src</code> attribute is placed on HTML image element</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: {{ A11yRoleRef("ROLE_GRAPHIC") }} for the &lt;html:img/&gt; element.</dd>
</dl>
<h3 id="Tree_related_attributes" name="Tree_related_attributes">Tree related attributes</h3>
<dl>
  <dt>
    cycles</dt>
  <dd>
    "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.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: {{ A11yRoleRef("ROLE_CELL") }} for the &lt;xul:{{ XULElem("tree") }}/&gt;</dd>
  <dd>
    Note: it's not exposed currently</dd>
</dl>
<h3 id="Table_related_attributes" name="Table_related_attributes">Table related attributes</h3>
<dl>
  <dt>
    layout-guess</dt>
  <dd>
    <code>true</code> when Gecko's heuristic determines that it is a table that is probably used for layout, not for table.<br />
    Value not set means it is probably a data table.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: {{ A11yRoleRef("ROLE_TABLE") }}</dd>
</dl>
<dl>
  <dt>
    table-cell-index {{ Deprecated_inline() }}</dt>
  <dd>
    The index of the table cell accessible. Use <code>{{ Interface("nsIAccessibleTable") }}</code> <code>and {{ Interface("nsIAccessibleTableCell") }}</code> instead.</dd>
</dl>
<dl>
  <dd>
    Applied to {{ A11yRoleRef("ROLE_CELL") }}</dd>
</dl>
<h3 id="Hypertext_attributes" name="Hypertext_attributes">Hypertext attributes</h3>
<dl>
  <dt>
    <code>formatting</code> {{ Deprecated_inline() }}</dt>
  <dd>
    "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 are typically formatted as a block, but there is no requirement that they 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 <code>display: inline</code>.</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: any object that supports the hypertext interface</dd>
  <dd>
    Note: deprecated, use <code>display</code> attribute instead</dd>
</dl>
<dl>
  <dt>
    <code>line-number</code></dt>
  <dd>
    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).</dd>
  <dd>
    &nbsp;</dd>
  <dd>
    Applied to: any focusable accessible text object</dd>
</dl>
<dl style="margin: 0px 0px 1.7em; padding: 0px;">
  <dt style="font-style: normal; font-weight: bold;">
    <code>margin-bottom</code> {{ gecko_minversion_inline("13.0") }}</dt>
  <dd>
    Specifies how much vertical space there will be after the bottom of the last line of content in a text accessible (see the CSS {{ cssxref("margin-bottom") }} property).</dd>
  <dt style="font-style: normal; font-weight: bold;">
    <code>margin-left</code> {{ gecko_minversion_inline("13.0") }}</dt>
  <dd>
    Specifies how much horizontal space there will be before the beginning of each line of content in a text accessible (see the CSS {{ cssxref("margin-left") }} property).</dd>
  <dt>
    <code>margin-right</code> {{ gecko_minversion_inline("13.0") }}</dt>
  <dd>
    Specifies how much horizontal space there will be after the end of each line of content in a text accessible (see the CSS {{ cssxref("margin-right") }} property).</dd>
  <dt>
    <code>margin-top</code> {{ gecko_minversion_inline("13.0") }}</dt>
  <dd>
    Specifies how much vertical space there will be before the top of the first line of content in a text accessible (see the CSS {{ cssxref("margin-top") }} property).</dd>
  <dt style="font-style: normal; font-weight: bold;">
    <code>text-align</code></dt>
  <dd style="margin-left: 0px; margin-bottom: 0.5em; padding-left: 15px;">
    Specifies how lines of text are aligned with each other (see CSS&nbsp;{{ cssxref("text-align") }}&nbsp;property).</dd>
</dl>
<dl style="margin: 0px 0px 1.7em; padding: 0px;">
  <dt style="font-style: normal; font-weight: bold;">
    text-indent</dt>
  <dd style="margin-left: 0px; margin-bottom: 0.5em; padding-left: 15px;">
    Specifies how much horizontal space should be left before beginning of the first line of the text content of an text accessible&nbsp;(see the CSS&nbsp;{{ cssxref("text-indent") }}&nbsp;property).</dd>
</dl>
<h3 id="Value_attributes" name="Value_attributes">Value attributes</h3>
<dl>
  <dt>
    valuetext</dt>
  <dd>
    A text equivalent to the current value, such as "High" in a slider or "Unzipping files" in a progress meter</dd>
  <dd>
    Applied to: Anything that supports the value interface, especially a slider or progress meter</dd>
</dl>
Revert to this revision