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 of label property is appended
    • otherwise
      • if it's a label element then then value attribute is appended
      • otherwise append tooltiptext attribute
    • append the accessible value

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 of id 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 by aria-labelledby attribute
<description id="descr1">label1</description>
<description id="descr2">label2</description>
<textbox aria-labelledby="descr1 descr2" />
<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 of toolbaritem element then title attribute of toolbaritem 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 by aria-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 the control attribute, if the description 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 or aria-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 then click action is exposed

XUL Elements

notification

Used to display an informative message. Role ROLE_ALERT

<panel noautofocus = "true" />

ROLE_ALERT

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:70 次

字数:6450

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文