Confirmed users
1,396
edits
Line 1,035: | Line 1,035: | ||
==Geometry== | ==Geometry== | ||
Outline can | The section contains bunch of methods and approaches to deal with web page geometry. | ||
===Outline=== | |||
AT can outline a position or a range enclosed between two positions. This feature is useful to track stuff like virtual cursor. | |||
<pre> | <pre> | ||
partial interface AccessibleDocument { | partial interface AccessibleDocument { | ||
void outline(AccessiblePos pos1, AccessiblePos pos2); | void outline(AccessiblePos pos1, optional AccessiblePos pos2); | ||
void clearOutlines(); | void clearOutlines(); | ||
}; | }; | ||
</pre> | </pre> | ||
<code> | <code> | ||
AccessibleDocument .''outline'' | AccessibleDocument .''outline'' | ||
::Outlines a range | ::Outlines a position if second position is omitted. If second position is omitted then outlines a collapsed range. | ||
AccessibleDocument .''clearOutlines'' | AccessibleDocument .''clearOutlines'' | ||
Line 1,052: | Line 1,055: | ||
</code> | </code> | ||
===Geometrical navigation=== | |||
AT can scan the web page by moving the position geometrically up/down/left/right. | |||
<pre> | <pre> | ||
var scanner | |||
{ | |||
start: function() { | |||
if (this.stopped) | |||
return; | |||
var nextpos = this.pos.move("right", this.controller); | |||
if (!nextpos) | |||
nextpos = this.pos.move("down", this.controller); | |||
if (nextpos) { | |||
document.outline(nextpos); | |||
: | window.setTimeout(this.start.bing(this), 1000); | ||
} | |||
}, | |||
stop: function() { | |||
this.stopped = true; | |||
}, | |||
controller: function(aEl) { | |||
var role = document.a11ement.taxonOf("role", aElm.role); | |||
if (role.is("widget")) | |||
return "at"; | |||
return "next"; | |||
} | |||
pos: new A11ePos(new DOMPoint(0, 0)), | |||
stopped: false | |||
} | |||
</pre> | |||
===Hit testing=== | ===Hit testing=== | ||
Line 1,096: | Line 1,112: | ||
</pre> | </pre> | ||
Questions/concerns | |||
*Outline: it's tricky to style that but maybe document or accessible should decide how it should be styled, for example, black outline on black background. | |||
*Do we need a way to return coordinates of accessible position's edge points? | |||
*Do we need a method to calculate distance between two positions? | |||
*Do we need a method to calculate boundaries (aka containing rect)? | |||
*Do we need a method to check whether the given point is contained by a range? | |||
==Events== | ==Events== |