Accessibility/TextInterface.Next: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 69: Line 69:
* relatively small change
* relatively small change
* supposed to solve navigation problem (#2)
* supposed to solve navigation problem (#2)
* partially solves problem (#1) since it lets words, line navigation with no embedded characters (reading the selection spanned through paragraphs is still complex)


Disadvantages:
Disadvantages:

Revision as of 15:39, 12 August 2014

IA2/ATK Text Interface. Next

Problems of exiting approach

  • (#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'

Use cases

  • Move by unit and get the text
  • Get selection
  • Get/set caret

Text Range API

Advantages:

  • solves both #1 and #2
  • nice concept in replace to embed characters and text offsets concepts
  • 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)
  • partially solves problem (#1) since it lets words, line navigation with no embedded characters (reading the selection spanned through paragraphs is still complex)

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)