Converts from a tree to a text position if the selection is not inside a text object
This patch fixes screen reader announcements when moving by character or by line in editable fields, either through a hard line break <br>, or through a blank line (<br><br>). A tree position is returned by the AX selection API when either the anchor offset or the focus offset refers to a child index and not to a character offset. We were not handling tree positions on Mac at all, whilst on Windows IA2 and Linux ATK we were not handling them if any of the caret or selection APIs were called on the anchor or the focus of the selection and not on one of their ancestors, e.g., calling IAccessibleText::get_caretOffset on a content editable that contains an img element as a direct child, and the caret being placed before the image. Tree positions were correctly handled on Windows IA2 and Linux ATK if the selection endpoints were inside a descendant of the current object, or in a completely different part of the tree. Bug: 951777 R=aleventhal@chromium.org Change-Id: Iac3c673c4c15668367f379d979d3f2457c9fefb0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1699017Reviewed-by:Aaron Leventhal <aleventhal@chromium.org> Commit-Queue: Nektarios Paisios <nektar@chromium.org> Auto-Submit: Nektarios Paisios <nektar@chromium.org> Cr-Commit-Position: refs/heads/master@{#678293}
Showing
Please register or sign in to comment