Files
tubestation/accessible/tests
James Teh 1276a883d6 Bug 1965405: When reconstituting a TextLeafRange for a UiaTextRange, restrict offsets to the current lengths of Accessibles. r=morgan
This is the scenario for this bug:

1. A UIA client retrieved a range for the caret at the end of a text input at the end of a document, collapsed at (input, 2).
2. Backspace was pressed, removing the last character, so (input, 2) was no longer valid.
3. The UIA client attempted to call GetAttributeValue on the previously fetched range.
4. FindTextAttrsStart couldn't move further, so it returned the document end point, (input, 1).
5. Because the range contained (input, 2), the search point was never less than the end point, so we got stuck in an infinite loop in GetAttributeValue.

To fix this, UiaTextRange now restricts offsets to the length of the leaf Accessibles when reconstructing the TextLeafRange.

Differential Revision: https://phabricator.services.mozilla.com/D248734
2025-05-13 04:05:58 +00:00
..