Always exposes an offset on a leaf object as a text position
When the anchor or the focus objects for a selection are on a platform leaf object, then the anchor and focus offsets should necessarily refer to a text position and not a tree position, since leaf objects never have children and therefore any anchor or focus offsets cannot refer to child indices. Objects that are designated as leaves on certain platforms might not be leaves on every platform. For example, in the internal accessibility tree, native text fields are not leaf objects. They include a whole subtree inside them, which exposes all of the text. However, AXSelection in Blink should never return positions that are inaccessible to platform APIs so it is a safe assumption that any position on a platform leaf object should refer to a text object. The user visible change is that editing now works on the Mac without random navigation errors. R=aleventhal@chromium.org Bug: 988139 Change-Id: I1180274222b8899ec81bb031c35def98d89594bd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1725129 Commit-Queue: Nektarios Paisios <nektar@chromium.org> Reviewed-by:Aaron Leventhal <aleventhal@chromium.org> Cr-Commit-Position: refs/heads/master@{#682293}
Showing
Please register or sign in to comment