GNOME Bugzilla – Bug 697779
atk_text_get_text_at_offset for ATK_TEXT_BOUNDARY_WORD_END is not consistent
Last modified: 2021-06-10 11:26:43 UTC
The test string "a paragraph" ATK spec states (https://developer.gnome.org/atk/stable/AtkText.html#atk-text-get-text-at-offset): "If the boundary_type is ATK_TEXT_BOUNDARY_WORD_END the returned string is from the word end before the offset to the word end at or after the offset. " then ('', 0, 0) seems reasonable as failure result because there's no the word end *before* 0 offset. however "The returned string will contain the word at the offset if the offset is inside a word and will contain the word after to the offset if the offset is not inside a word. " makes ('a ', 0, 2) reasonable because 0 offset is inside word offset of 'a' word. It'd be great if you clarify the spec. It's urgent for Firefox accessibility.
(In reply to comment #0) > "The returned string will contain the word at the offset if the offset is > inside a word and will contain the word after to the offset if the offset is > not inside a word. " > > makes ('a ', 0, 2) reasonable because 0 offset is inside word offset of 'a' > word. correction: should be (a', 0, 1) because 1 is the end offset of 'a' word
Word start boundary is a dual case to described one for character count offset: " If the boundary_type is ATK_TEXT_BOUNDARY_WORD_START the returned string is from the word start at or before the offset to the word start after the offset. " there's no offset *after* character count offset and " The returned string will contain the word at the offset if the offset is inside a word and will contain the word before the offset if the offset is not inside a word. " but this one assumes that last word should be returned ("a paragraph")
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of atk, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a ticket at https://gitlab.gnome.org/GNOME/atk/-/issues/ Thank you for your understanding and your help.