Browse mode: When the user moves the cursor, speak before setting selection.#10389
Merged
Merged
Conversation
…ection. Previously, for both normal cursor movement and quick navigation, we set the selection before speaking. However, setting selection might move the focus, which might mutate the document. For virtual buffers, the TextInfo is offset-based, so this could invalidate the offsets, causing the wrong part of the document to be spoken. To get around this, we now speak before setting the selection.
|
Hi this definitely improves the issue I had yesterday on another page which
I created, but do not have it to hand. Although sometimes you still get
partial button text spoken you can now actually find the buttons reliably.
No idea why this should work, but.. it does.
Brian
bglists@blueyonder.co.uk
Sent via blueyonder.
Please address personal E-mail to:-
briang1@blueyonder.co.uk, putting 'Brian Gaff'
in the display name field.
Newsgroup monitored: alt.comp.blind-users
----- Original Message
|
michaelDCurran
approved these changes
Oct 21, 2019
michaelDCurran
added a commit
that referenced
this pull request
Oct 21, 2019
JulienCochuyt
added a commit
to accessolutions/nvda
that referenced
this pull request
Nov 4, 2019
…setting selection. (PR nvaccess#10389)
michaelDCurran
added a commit
that referenced
this pull request
Mar 10, 2020
…elected in browseMode again. Fixes regression caused by #10389.
michaelDCurran
added a commit
that referenced
this pull request
Mar 11, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Fixes #8831. Fixes #10343.
Summary of the issue:
In browse mode, if you move the cursor to something focusable and focusing it causes content earlier in the document to be removed, NVDA reports the wrong part of the document. See the issues linked above for test cases.
Description of how this pull request fixes the issue:
Currently, for both normal cursor movement and quick navigation, we set the selection before speaking. However, setting selection might move the focus, which might mutate the document. For virtual buffers, the TextInfo is offset-based, so this could invalidate the offsets, causing the wrong part of the document to be spoken. To get around this, this change speaks before setting the selection instead of after.
Testing performed:
Verified with the test cases in the issues linked above.
Known issues with pull request:
If the newly focused element mutates its own content when focused, we won't speak the mutated content, since we speak before focusing. However, I think that's far less egregious than the problem we're fixing here and less likely to be a "real" problem.
We could fix this for quick nav by somehow re-fetching the TextInfo from the QuickNavItem between the moveTo and report calls. However, I don't think this can be done for normal cursor movement, since normal cursor movement isn't bounded by a single object. I don't think we want to be inconsistent here.
Change log entry:
Bug fixes:
- In browse mode, if moving the cursor or using quick navigation causes the document to change, NVDA no longer speaks incorrect content in some cases. (#8831, #10343)