[Accessibility-ia2] magic numbers to indicate special positions on text methods

Aaron Leventhal aaronlev at moonset.net
Fri Nov 30 08:53:31 PST 2007


The IDL should provide constants for these:
const long IAccessibleText::OFFSET_END_OF_TEXT = - 1
const long IAccessibleText::OFFSET_CARET = -2

When OFFSET_CARET is used with BOUNDARY_LINE_END the implementation 
would be responsible for using the actual line the caret is shown on, 
not the logical character offset which can be misleading.

Make sense?

- Aaron

Pete Brunet wrote:
>
> The Firefox a11y team has requested that we use -2 as a magic number 
> offset on calls to IAText methods to indicate that the offset is 
> wherever the caret is at.  This is especially useful when at the end 
> of the line because app behavior is often idiosyncratic at the end of 
> the line, e.g. Aaron tested Notepad, Wordpad and Microsoft Word 2003. 
> This is for the scenario where text wraps to the next line.
>
> 1. If you hit End, you're past the last char of the line. You're 
> really on the first char of the next line. Although visually you're on 
> the same line, logically you're on the next line, because the delete 
> key will delete the first char of the next line, and right arrow will 
> go to the 2nd char of the next line.
> 2. If you right arrow through a line, you never reach that final 
> position where you're past the end. When you're on the space for the 
> end of the line, the next right arrow key brings you to the next line.
> 3. This means that if your press End. left arrow, right arrow you 
> change lines!
> 4. If you press the end key, then right arrow you won't hear the first 
> char of the line you've moved to
> 5. If you press up or down arrow and you're near the end of a long 
> line, you can end up past the end-of-line space char  if you've moved 
> to a shorter line. Logically you haven't changed lines, only visually
>
> Another magic number is -1 which would mean end of line.  
>
> The methods involved are:
>
> IAText::characterExtents, text, textBeforeOffset, textAfterOffset, 
> textAtOffset, setCaretOffset, scrollSubstringTo, scrollSubstringToPoint
> IAEditableText::copyText, deleteText, insertText, cutText, pasteText, 
> replaceText, setAttributes
> IEHypertext::hyperlinkIndex
>
> Please let us know if there are any issues foreseen regarding this 
> proposed enhancement.
>
> *Pete Brunet*
>                                                                          
> IBM Accessibility Architecture and Development
> 11501 Burnet Road, MS 9022E004, Austin, TX 78758
> Voice: (512) 838-4594, Cell: (512) 689-4155
> Ionosphere: WS4G
> ------------------------------------------------------------------------
>
> _______________________________________________
> Accessibility-ia2 mailing list
> Accessibility-ia2 at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/accessibility-ia2
>   



More information about the Accessibility-ia2 mailing list