Skip to content
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 UIA Word movement tests #11253

Merged
3 commits merged into from
Sep 22, 2021
Merged

Conversation

carlos-zamora
Copy link
Member

Summary of the Pull Request

Fixes the 24 failing generated tests. 20 of them were fixed by enforcing the following rule: when moving backwards by word...

  • a degenerate range moves to the beginning of the word, then to the word behind it.
  • a non-degenerate range outright moves to the word behind it.

The fix was simple: if we're a degenerate range, check if we're at the beginning of the word. If not, move there. Otherwise, move to the word before it. See UiaTextRangeBase.cpp changes for implementation details.

Along the way, several misauthored tests were found:

  • 2 generated tests:
    • Cause: MS Word considers a line break a word delimiter. We don't use line-wrapping to distinguish two separate words.
  • MovementAtExclusiveEnd backwards word movement tests:
    • end will always be writeTarget because...
      • [degenerate range case] both start and end are moved to the beginning of the word (writeTarget)
      • [non-degenerate range case] from the UiaTextRangeBase bugfix, we should be moving to the word behind it.
    • this misauthored test was explicitly found by fixing the bug first explained here.

References

#10925 Word navigation testing

@codeofdusk
Copy link
Contributor

codeofdusk commented Sep 17, 2021

If there are any remaining cases of #7960/#10819 I imagine this PR should sort those!

@carlos-zamora
Copy link
Member Author

If there are any remaining cases of #7960/#10819 I imagine this PR should sort those!

At this point, no. All of the generated tests were verified to match the behavior of MS Word. The only exception being the 2 mentioned in the PR body (regarding line wrapping).

@zadjii-msft zadjii-msft added the Area-Accessibility Issues related to accessibility label Sep 22, 2021
@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Sep 22, 2021
@ghost
Copy link

ghost commented Sep 22, 2021

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 5deb332 into main Sep 22, 2021
@ghost ghost deleted the dev/cazamor/a11y-7000/word-nav-test-fixing branch September 22, 2021 17:50
seanbudd pushed a commit to nvaccess/nvda that referenced this pull request Jun 21, 2022
…(Windows 11 Sun Valley 2) (#10964)

Supersedes #9771 and #10716. Closes #1682. Closes #8653. Closes #9867. Closes #11172. Closes #11554.

Summary of the issue:

Microsoft has significantly improved performance and reliability of UIA console:
* microsoft/terminal#4018 is an almost complete rewrite of the UIA code which makes the console's UIA implementation more closely align with the API specification.
* microsoft/terminal#10886, microsoft/terminal#10925, and microsoft/terminal#11253 form a robust testing methodology for the UIA implementation, including bug fixes in response to newly added tests based on Word's UIA implementation.
* microsoft/terminal#11122 removes the thousands of empty lines at the end of the console buffer, significantly improving performance and stability. Since all console text ranges are now within the text buffer's bounds, it is no longer possible for console to crash due to the manipulation by UIA clients of an out-of-bounds text range.
* Countless other accessibility-related PRs too numerous to list here.

We should enable UIA support on new Windows Console builds by default for performance improvement and controllable password suppression.

Description of how this pull request fixes the issue:

This PR:
* Exposes all three options for the UIA console feature flag in the UI (replaces the UIA check box with a combo box).
* Adds a runtime check to test if `apiLevel >= FORMATTED`, and use UIA in this case when the user preference is auto. This is the case on Windows 11 Sun Valley 2 (SV2) available now in beta and set for release in the second half of 2022.
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Accessibility Issues related to accessibility AutoMerge Marked for automatic merge by the bot when requirements are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants