Accessibility/TextInterface.Next

IA2/ATK Text Interface. Next

What's bad in exiting interface

  • (#1) Embedded objects concepts adds complexity which potentially affects on performance
  • (#2) Hard to figure what the word is. Example
    <p>a<a>b</a><c></p>
    p is one word 'abc'

Text Range API

Advantages:

  • solves both #1 and #2
  • nice concept in replace to text offsets concept
  • doesn't have text offsets restrictions like one text offsets may describe two text points (for example, caret right before a link and inside the link
  • close to UIA which is good in terms of portability
  • more steady to bugs since wrong move in text is better than wrong offsets because wrong move allows to traverse the whole text while wrong offsets usually don't

Disadvantages:

  • can be complex for implementation
types:
TextRange
Accessible
TextEndPoint: EP_start, EP_end
TextEndPoints: EPS_startToStart, EPS_startToEnd, EPS_endToStart, EPS_endToEnd
TextUnit: UNIT_PARAGRAPH, UNIT_LINE, UNIT_WORD, UNIT_CHARACTER
TextPosition: POS_FIRST, POS_LAST, POS_ALL, POS_CARET, POS_SELECTION
TextAttributes
Rect

TextRange:
void compareEndPoints(TextRange other, TextEndPoints which)
void setEndPoint(TextRange other, TextEndPoints which)
void expand(TextUnit unit)
void move(TextUnit unit, long direction, TextEndPoint endPoint)
TextRange copy()
void updateCaret()
void updateSelection()
optional: isCollapsed, collapse
TextRange[] childRanges()
TextAttributes attributes()
Accessible enclosingAccessible()
Rect screenLocation()

TextProvider:
TextRange rangeForAccessible(Accessible accessible)
TextRange rangeForPosition(TextPosition position)
TextRange rangeForScreenLocation(Rect location)

No embed objects for inlines

Advantages:

  • a relatively small changes, totally goes with IA2 and ATK specifications
  • solves words navigation problem (#2)

Disadvantages:

  • not backward compatible since AT might have dependencies on exiting implementation, AT sniffing can be a requirement
  • doesn't solve complexity problem (#1)

Text Interface Extension

Advantages:

  • relatively small change
  • supposed to solve navigation problem (#2)

Disadvantages:

  • doesn't solve perf problem (#1) in general
getUnitBoundaries(Accessible accessible, long offset, Unit unit, Accessible* startAccessible, long* startOffset, Accessible* endAccessible, long* endOffset)
findNextChange(Accessible startAccessible, long startOffset, Accessible endAccessible, long endOffset, Accessible* changeAccessible, long* changeOffset)