-
-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix movement at end of document for modern UIA providers #12898
Conversation
) In Microsoft Word, new builds of Windows Console, and Edgium with UIA enabled, "bottom" is not reported when moving past the end of the document in review. These providers return nonzero when moving collapsed textInfos forward past the end, but simply set them to POSITION_LAST (i.e. collapsed at the very end of the document). If a UIA provider reports that a collapsed range has successfully been moved forward (i.e. move returns nonzero), but the new range is collapsed at POSITION_LAST, return 0 and restore the range to its original position.
Marking this for review, though the build is failing and I can't figure out why. |
) In Microsoft Word, new builds of Windows Console, and Edgium with UIA enabled, "bottom" is not reported when moving past the end of the document in review. These providers return nonzero when moving collapsed textInfos forward past the end, but simply set them to POSITION_LAST (i.e. collapsed at the very end of the document). If a UIA provider reports that a collapsed range has successfully been moved forward (i.e. move returns nonzero), but the new range is collapsed at POSITION_LAST, return 0 and restore the range to its original position.
) In Microsoft Word, new builds of Windows Console, and Edgium with UIA enabled, "bottom" is not reported when moving past the end of the document in review. These providers return nonzero when moving collapsed textInfos forward past the end, but simply set them to POSITION_LAST (i.e. collapsed at the very end of the document). If a UIA provider reports that a collapsed range has successfully been moved forward (i.e. move returns nonzero), but the new range is collapsed at POSITION_LAST, return 0 and restore the range to its original position.
) In Microsoft Word, new builds of Windows Console, and Edgium with UIA enabled, "bottom" is not reported when moving past the end of the document in review. These providers return nonzero when moving collapsed textInfos forward past the end, but simply set them to POSITION_LAST (i.e. collapsed at the very end of the document). If a UIA provider reports that a collapsed range has successfully been moved forward (i.e. move returns nonzero), but the new range is collapsed at POSITION_LAST, return 0 and restore the range to its original position.
This pr doesn't solve the following case:
How are those degenerate ranges supposed to behave? Is it expected behaviour that you can't move from position last at all, even not backwards? |
Word and |
Apologies, ignore the build failure, we had to fix something to work with the latest Windows SDK - see #12903. |
Thanks @seanbudd. It looks like this PR built successfully so is now ready for review. |
Note that this pr replaces #12825. Before going further on this, I think we should define expected behavior for the following case:
Actual behavior for Notepad: Method returns 0, textInfo still collapsed at start of line I think both make sense equally, with a slight preference for the UIA behavior. This pr changes that. I think we should agree on behavior first before continuing. |
The UIA implementation causes the following problem:
|
Yes, I see. My question intends to bring the discussion on a more fundamental level, i.e. what do we expect? We could patch the UIA implementation but could also consider changing NVDA"s behavior. Additional details:
So to summarize, the behavior I describe in #12898 (comment) when moving by line from the start of the last line of the document to return 0 and stay on the start of the last line only applies to offset based textInfo. |
How do you suggest changing NVDA's behaviour? |
If we change the move method on OffsetsTextinfo in such a way that it moves to the end of the range when moving from the start of the last line, we can change the global command to fetch the last position of the textInfo
Then, we can compare the new position with that and report bottom appropriately. This is somehow similar to how script_review_nextCharacter works to ensure that the review cursor doesn't move past the end of the line. |
I've attempted to implement this change in #12916. Your review would be appreciated! |
) In Microsoft Word, new builds of Windows Console, and Edgium with UIA enabled, "bottom" is not reported when moving past the end of the document in review. These providers return nonzero when moving collapsed textInfos forward past the end, but simply set them to POSITION_LAST (i.e. collapsed at the very end of the document). If a UIA provider reports that a collapsed range has successfully been moved forward (i.e. move returns nonzero), but the new range is collapsed at POSITION_LAST, return 0 and restore the range to its original position.
) In Microsoft Word, new builds of Windows Console, and Edgium with UIA enabled, "bottom" is not reported when moving past the end of the document in review. These providers return nonzero when moving collapsed textInfos forward past the end, but simply set them to POSITION_LAST (i.e. collapsed at the very end of the document). If a UIA provider reports that a collapsed range has successfully been moved forward (i.e. move returns nonzero), but the new range is collapsed at POSITION_LAST, return 0 and restore the range to its original position.
Closing in favour of #12960. |
Link to issue number:
Closes #12808.
Summary of the issue:
In Microsoft Word, new builds of Windows Console, and Edgium with UIA enabled, "bottom" is not reported when moving past the end of the document in review. These providers return nonzero when moving collapsed
textInfo
s forward past the end, but simply set them toPOSITION_LAST
(i.e. collapsed at the very end of the document).Description of how this pull request fixes the issue:
If a UIA provider reports that a collapsed range has successfully been moved forward (i.e.
move
returns nonzero), but the new range is collapsed atPOSITION_LAST
, return0
and restore the range to its original position.Testing strategy:
Tested that movement in review works as expected in Word,
FORMATTED
consoles, and Edgium.Known issues with pull request:
This might have a slight performance impact, but I've tried to optimize this so that we only make extra UIA calls for this specific case.
Change log entries:
== Bug Fixes ==
Code Review Checklist: