Confirmed users
1,396
edits
Line 532: | Line 532: | ||
AccessiblePos? move(DOMNode container, long offset); | AccessiblePos? move(DOMNode container, long offset); | ||
AccessiblePos? move(DOMPoint); | AccessiblePos? move(DOMPoint); | ||
AccessiblePos? move(Where where, | AccessiblePos? move(Where where, Controller); | ||
AccessiblePos? search(Where where, | AccessiblePos? search(Where where, Controller); | ||
readonly attribute AccessibleElement root; | readonly attribute AccessibleElement root; | ||
Line 574: | Line 574: | ||
<code> | <code> | ||
OffsetLiterals .'' | OffsetLiterals .''before'' | ||
::Used to set the accessible position right before the accessible element beginning | ::Used to set the accessible position right before the accessible element beginning | ||
</code> | </code> | ||
Line 594: | Line 594: | ||
<code> | <code> | ||
OffsetLiterals .'' | OffsetLiterals .''after'' | ||
::Used to set the accessible position right after the accessible element ending | ::Used to set the accessible position right after the accessible element ending | ||
</code> | </code> | ||
Line 637: | Line 637: | ||
var pos2 = new A11ePos(button.accessibleElement, "at"); | var pos2 = new A11ePos(button.accessibleElement, "at"); | ||
var pos3 = new A11ePos(paragraph.accessibleElement, " | var pos3 = new A11ePos(paragraph.accessibleElement, "afterbegin"); | ||
var pos4 = new A11ePos(pos2); | var pos4 = new A11ePos(pos2); | ||
Line 674: | Line 674: | ||
AccessiblePos .''move''(Where, | AccessiblePos .''move''(Where, Controller) | ||
::Move the accessible position to the content. Returns true if succeeded. | ::Move the accessible position to the content. Returns true if succeeded. | ||
::Parameters | ::Parameters | ||
:::''where'' of ''Where'' | :::''where'' of ''Where'' | ||
::::where the search should be performed | ::::where the search should be performed | ||
:::'' | :::''controller'' of ''Controller'' | ||
::::function describing a match | ::::function describing a match | ||
:::Return itself. | :::Return itself. | ||
AccessiblePos .''search''(Where, | AccessiblePos .''search''(Where, Controller) | ||
::Finds the accessible position relative the current one. Returns new instance. | ::Finds the accessible position relative the current one. Returns new instance. | ||
::Parameters | ::Parameters | ||
:::''where'' of ''Where'' | :::''where'' of ''Where'' | ||
::::where the search should be performed | ::::where the search should be performed | ||
:::'' | :::''controller'' of ''Controller'' | ||
::::function describing a match | ::::function describing a match | ||
:::Return new instance. | :::Return new instance. | ||
Line 756: | Line 756: | ||
Examples: | Examples: | ||
<pre> | <pre> | ||
function | function controller(elm) { } | ||
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move("forward", | var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move("forward", controller); | ||
var pos2 = new A11ePos(elm, "at").move("backward", | var pos2 = new A11ePos(elm, "at").move("backward", controller); | ||
var pos3 = new A11ePos(pos).move("forward", | var pos3 = new A11ePos(pos).move("forward", controller); | ||
or | or | ||
var pos2 = pos2.search("forward", | var pos2 = pos2.search("forward", controller); | ||
</pre> | </pre> | ||
Line 771: | Line 771: | ||
<pre> | <pre> | ||
callback | callback Controller = SearchTerm sequence<SearchTerm> (AccessibleElement); | ||
</pre> | </pre> | ||
<code> | <code> | ||
Controller | |||
::A matching function used to define an algorithm of how the position is moved through the document. | ::A matching function used to define an algorithm of how the position is moved through the document. | ||
::Returns | ::Returns | ||
Line 855: | Line 855: | ||
<pre> | <pre> | ||
var pos1 = new A11ePos(document.getElementById("a").a11ement); | var pos1 = new A11ePos(document.getElementById("a").a11ement); | ||
var pos2 = pos1.search("forward", () = > {return [ "word", "stop" ];}); | var pos2 = pos1.search("forward", () = > { return [ "word", "stop" ];}); | ||
var pos3 = pos1.search("forward", () => {return "word"; }); | var pos3 = pos1.search("forward", () => { return "word"; }); | ||
</pre> | </pre> | ||
Line 872: | Line 872: | ||
<b> Example. Navigate by widgets and structures, and by words in case of text.</b> | <b> Example. Navigate by widgets and structures, and by words in case of text.</b> | ||
<pre> | <pre> | ||
function | function controller(aEl) | ||
{ | { | ||
var role = document.taxonOf("role", | var role = document.taxonOf("role", aEl.role); | ||
if (role.is("widget") | if (role.is("widget") | ||
return [ "at", "skipsubtree" ]; | return [ "at", "skipsubtree" ]; |