XUL Accessibility 编辑
Introduction
This article shows how XUL control elements are mapped to accessibility API. It is much in progress.
AT API
General rules
This section holds some rules applied to generating accessible name and description.
Aggregating the text from element subtree
- if the child node is hidden then it's ignored excepting the case when the element used as label is hidden itself
- If the child node is text node then its rendered value is appended
- If the child node is element then
- if it implements
nsIDOMXULLabeledControlElement
then the value oflabel
property is appended - otherwise
- if it's a
label
element then thenvalue
attribute is appended - otherwise append
tooltiptext
attribute
- if it's a
- append the accessible value
- if it implements
Searching specific element in neighbour of the element
- search inside the element subtree
- go up through parents (max level is 5) and search inside theirs subtrees
- if the element is anonymous then search in whole anonymous subtree, here the attribute
anonid
is used instead ofid
attribute
Accessible properties
This section describes common rules how accessibility properties are formed for XUL elements.
name
The following rules to generate accessible name are applied:
- check
aria-labelledby
attribute, name is generated from elements pointed byaria-labelledby
attribute
<description id="descr1">label1</description> <description id="descr2">label2</description> <textbox aria-labelledby="descr1 descr2" />
- if the element implements
nsIDOMXULLabeledControlElement
ornsIDOMXULSelectControlItemElement
interface then it is usedlabel
property - if the element doesn't implement
nsIDOMXULSelectControlElement
thenlabel
attribute is used - if neighbour of the element has
label
element pointing to this element by thecontrol
attribute, if thelabel
element is found then usevalue
attribute or its content.
<label value="it's label for control" control="control" /> <hbox role="grouping" id="control" />
- get
tooltiptext
attribute - if the element is anonymous child of the element that is the direct child of
toolbaritem
element or the element is direct child oftoolbaritem
element thentitle
attribute oftoolbaritem
element is used (currently it's used in Firefox UI only) - if the element has ARIA role and the role allows to aggregate name from subtree of element then generate name from subtree of the element
description
The following rules to generate accessible description are applied:
- check
aria-describedby
attribute, description is generated from elements pointed byaria-describedby
attribute
<description id="descr1">label1</description> <description id="descr2">label2</description> <textbox aria-describedby="descr1 descr2" />
- if neighbour of the element has
description
element pointing to this element by thecontrol
attribute, if thedescription
element is found then use its content.
<description value="it's label for control" control="control" /> <hbox role="grouping" id="control" />
- get
tooltiptext
attribute
value
- If the ARIA role is used and it allows to have accessible value then
aria-valuetext
oraria-valuenow
are used - If the element is XLink then value is generated from link location
actions
- If the element is XLink then
jump
action is exposed - If the element has registered
click
event handler thenclick
action is exposed
XUL Elements
notification
Used to display an informative message. Role ROLE_ALERT
<panel
noautofocus = "true" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论