Normalize review by collapsing before expanding #12825
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Closes #12808.
Summary of the issue:
Due to differences in behaviour between UIA and MSAA text ranges, some UIA text ranges never report "bottom" when moving past the last line of text.
Description of how this pull request fixes the issue:
In review, normalize text ranges by collapsing to start before expanding by the unit being reviewed (i.e. move an expanded range, not a collapsed one).
Testing strategy:
Tested Microsoft Word with UIA enabled, an upcoming UIA Windows Console, and Notepad (both MSAA and UIA proxied MSAA) by moving through multiline text. Verified that "bottom" is properly reported when moving by line in all cases.
Known issues with pull request:
I'm not 100% set on this approach, mostly because I don't fully understand this code. This may introduce additional bugs.
I've opened this PR as a possible fix and to start a discussion on resolving this issue as it will continue affecting word (even after UIA) and will soon affect consoles.
Change log entries:
== Bug Fixes ==
Code Review Checklist: