Confirmed users
1,396
edits
| Line 1,201: | Line 1,201: | ||
::Toggle the state on the accessible element. | ::Toggle the state on the accessible element. | ||
</code> | </code> | ||
<b>Example.</b> | <b>Example.</b> | ||
| Line 1,364: | Line 1,363: | ||
or set it directly on the accessible element | or set it directly on the accessible element | ||
<pre> | |||
document.getElementById("btn").a11ement.name = "new name"; | document.getElementById("btn").a11ement.name = "new name"; | ||
</pre> | </pre> | ||
or by setting its accessible source | or by setting its accessible source | ||
| Line 1,479: | Line 1,478: | ||
In case if interactions cannot be provided then the accessible source have to implement <code>activate</code> method to invoke actions. | In case if interactions cannot be provided then the accessible source have to implement <code>activate</code> method to invoke actions. | ||
An accessible source property change | ===Feedback=== | ||
An accessible element may be notified of any kind of event, including its accessible source property change. In case of notification the browser will fire accessible events and update its cache if necessary. Decision when to notify the browser or not should be based on accessible events model. In other words if the property change in native markup causes an accessible event then same change in accessible source requires it too. | |||
<pre> | <pre> | ||
partial interface AccessibleElement { | partial interface AccessibleElement { | ||
void notifyOf(DOMString | void notifyOf(DOMString eventType, optional Object attrs); | ||
}; | }; | ||
</pre> | </pre> | ||
| Line 1,497: | Line 1,497: | ||
::::Name of the property like ''role'' or ''state'' | ::::Name of the property like ''role'' or ''state'' | ||
:::value | :::value | ||
::::Value | ::::Value describing the event. | ||
</code> | </code> | ||
| Line 1,504: | Line 1,504: | ||
<pre> | <pre> | ||
var listboxSource = { | var listboxSource = { | ||
role: "listbox", | role: "listbox", | ||
name: "breed list", | |||
states: "disabled", | |||
get element() { return this.elm; } | |||
set element(aElm) { | |||
this.elm = aElm; | |||
this.elm.notifyOf("change:name"); | |||
this.elm.notifyOf("change:states", { added: "disabled" }); | |||
} | |||
}; | }; | ||
</pre> | </pre> | ||