Accessibility/WebAccessibilityAPI: Difference between revisions

Jump to navigation Jump to search
Line 735: Line 735:




====Move through the content====
====Change the position====
 
There is a bunch of methods to change accessible position.


<code>
<code>
Line 745: Line 747:
:::''offset'' of ''Offsest'', optional
:::''offset'' of ''Offsest'', optional
::::offset relative the anchor
::::offset relative the anchor
:::Return itself.
:::Return itself or null if not succeeded.




Line 755: Line 757:
:::''offset'' of ''long''
:::''offset'' of ''long''
::::offset relative the anchor
::::offset relative the anchor
:::Return itself.
:::Return itself or null if not succeeded.




Line 763: Line 765:
:::''point'' of ''DOMPoint''
:::''point'' of ''DOMPoint''
::::the point the accessible position should be moved to.
::::the point the accessible position should be moved to.
:::Return itself.
:::Return itself or null if not succeeded.
 
 
====Move through the content====


Accessible position can be moved through the content by criteria.


AccessiblePos .''move''(Where, Controller)
AccessiblePos .''move''(Where, Criteria)
::Move the accessible position to the content. Returns true if succeeded.
::Move the accessible position to the content complying with criteria.
::Parameters
::Parameters
:::''where'' of ''Where''
:::''where'' of ''Where''
Line 773: Line 779:
:::''controller'' of ''Controller''
:::''controller'' of ''Controller''
::::function describing a match
::::function describing a match
:::Return itself.
:::Return itself if succeeded, otherwise null.




AccessiblePos .''search''(Where, Controller)
AccessiblePos .''search''(Where, Criteria)
::Finds the accessible position relative the current one. Returns new instance.
::Search for content of the given criteria relative the accessible position.
::Parameters
::Parameters
:::''where'' of ''Where''
:::''where'' of ''Where''
Line 783: Line 789:
:::''controller'' of ''Controller''
:::''controller'' of ''Controller''
::::function describing a match
::::function describing a match
:::Return new instance.
:::Return new instance if succeeded, otherwise null.
</code>
</code>


=====Search area=====
Methods traverse the accessible elements and runs the criteria function against each traversee for a match. The traversal is performed either by accessible tree hierarchy or by accessible elements layout on the screen what depends on <code>Where</code> argument.


<pre>
<pre>
enum Where { "forward",
enum Where {
            "backward",
  "forward",
            "cyclic forward",
  "backward",
            "cyclic backward",
  "cyclic forward",
            "tofirst",
  "cyclic backward",
            "tolast",
  "tofirst",
            "left",
  "tolast",
            "right",
 
            "up",
  "left",
            "down",
  "right",
            "above",
  "up",
            "under",
  "down",
            "closest"
  "above",
  "under",
  "closest"
};
};
</pre>
</pre>
Line 848: Line 860:
Examples:
Examples:
<pre>
<pre>
function controller(elm) { }
function criteria(el) { }
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move("forward", controller);
var pos1 = new A11ePos(new DOMPoint(x, y), a11edoc).move("forward", criteria);


var pos2 = new A11ePos(elm, "at").move("backward", controller);
var pos2 = new A11ePos(elm, "at").move("backward", criteria);


var pos3 = new A11ePos(pos).move("forward", controller);
var pos3 = new A11ePos(pos).move("forward", criteria);
or
or
var pos2 = pos2.search("forward", controller);
var pos2 = pos2.search("forward", criteria);
</pre>
</pre>






=====Matching function=====
=====Criteria function=====


<pre>
<pre>
Confirmed users
1,396

edits

Navigation menu