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

Better handle dead caret / selection text ranges in Microsoft Edge #7997

Merged
merged 1 commit into from Mar 6, 2018

Conversation

Projects
None yet
4 participants
@michaelDCurran
Contributor

michaelDCurran commented Feb 13, 2018

Link to issue number:

MS bug 14251419: NVDA Desktop : MSA : We are blocked to Enter password while using NVDA Screen reader.
MS bug 15577569: NVDA announces nothing when user presses ALT + LEFT/RIGHT arrow keys.

Summary of the issue:

In many cases, the UIA textRanges we get from Microsoft Edge, may become broken or die if the page mutates a significant amount.
Two examples:

  • Going back to a previous page with alt+leftArrow: The caret position we had stored previously for that document is now dead and cannot be used to rstore the caret position.
  • Signing into a Microsoft Account with the standard Microsoft Account screen: after entering an email address and pressing enter, nothing is reported for the focus as you move around the page, and links cannot be activated. In this case the caret position we had stored on the cursorManager had died because of signficant page mutations.

Description of how this pull request fixes the issue:

  1. UIABrowsemode documents no longer support remembering the last caret position on a previous document. This never worked and only caused errors.
  2. the Edge TreeInterceptor document overrides makeTextInfo to detect when a broken caret is being fetched. In this case it falls back to using the first position in the document, and updates the stored selection with this.

Testing performed:

  • Read and navigated multiple pages in Microsoft Edge, including switching back and forth in the history. When switching, the new page would be read from the top. Previously in most cases an error would occur and the page would not read.
  • Tried signing into a Microsoft Account: Settings -> accounts -> email and app acocunts -> Add a Microsoft Account. After entering the email address and pressing enter, NVDA correctly reported the password field, and all other controls as focus moved.

Known issues with pull request:

Change log entry:

Bug fixes:

  • NVDA no longer fails to read focused controls in the Microsoft Account sig-in screen in Settings after entering an email address.
  • NVDA no longer fails to read the page when going back to a previous page in Microsoft Edge.
Better handle dead caret / selection text ranges in Microsoft Edge.
Specifically:
* No longer support remembering the last caret position  for previously visited documents in Edge. This never worked and only caused errors. The UIA textRange we stored could not be used on new documents.
* Detect and fix the case where the textRange we have stored as the browseMode selection dies due to major page mutations.  Replace it with the first psoition in the document in this case.

@michaelDCurran michaelDCurran requested a review from feerrenrut Feb 13, 2018

@Adriani90

This comment has been minimized.

Show comment
Hide comment
@Adriani90

Adriani90 Feb 14, 2018

this could be related to #7838

Adriani90 commented Feb 14, 2018

this could be related to #7838

michaelDCurran added a commit that referenced this pull request Feb 14, 2018

@michaelDCurran michaelDCurran merged commit 59de1dc into master Mar 6, 2018

@nvaccessAuto nvaccessAuto removed the incubating label Mar 6, 2018

@nvaccessAuto nvaccessAuto added this to the 2018.1 milestone Mar 6, 2018

@michaelDCurran michaelDCurran modified the milestones: 2018.1, 2018.2 Mar 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment