On 4/16/13 1:29 AM, Alexander Surkov wrote: > Hi. There are couple issues with IAccessibleText spec. > > 1) IAccessibleText::getTextAtOffset interface wording is a bit > confusing [1], it says: > > "If the index is valid, but no suitable word (or other text type) is > found, a NULL pointer is returned." > > This makes me think (presumably makes me think wrong) that if the > offset is outside the word then there's no suitable world. However the > boundary types part says [2]: > > "The range provided matches the range observed when the application > processes the Ctrl + left arrow and Ctrl + right arrow key sequences. > Typically this is from the start of one word to the start of the next". > > It means the previous word should be returned. > > Notes: > > a) A word start boundary from ATK (an analogy to IA2 word boundary) > says to return previous word as well [3]: > > " will contain the word before the offset if the offset is not inside > a word." > > b) Firefox returns previous word in this case too. > Hi Alex, What does ATK do when the text area is full of spaces and no other text? That seems like the case where S_FALSE and NULL would be returned (except in the case of IA2_TEXT_BOUNDARY_CHAR/ALL).
How about this rewording? Returns the substring of the specified text type at the specified offset. Refer to IA2TextBoundaryType for more details. For the word boundary type if the offset is not at the beginning or inside a word the returned string will contain the word before the offset. Boundary types of sentence and paragraph should exhibit similar behavior. If the index is valid, but no suitable text for the specified boundary type is found, a NULL pointer is returned. This would only happen for boundary types of word, sentence, and paragraph when the text only consists of spaces. > > > 2) If the given offset is a word start then Ctrl+left arrow and Ctrl + > right arrow return a previous word. Should an order be opposite > instead since it contradicts to getTextAtOffset semantic? > I didn't follow that, e.g. why should ctrl+rightArrow move to the previous word, but hopefully the above rewording will address your issue. > > ATK says to return this word (i.e. the offset it belongs to), Firefox > does it in ATKish way. > > > [1] > http://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/interface_i_accessible_text.html#a9bd84b099ac7ce2435280549e90c8827 > > [2] > http://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/_accessible_text_8idl.html#ad3da05c9bed9f44b1e52eb4adb2924f6 > > [3] > https://developer.gnome.org/atk/stable/AtkText.html#atk-text-get-text-at-offset > > > Thank you. > > Alex. > _______________________________________________ Accessibility-ia2 mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/accessibility-ia2
