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

[A11y] Initialize and copy _blockRange in UIA Clone #10544

Merged
2 commits merged into from
Jul 6, 2021

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Jul 1, 2021

Summary of the Pull Request

#7960 was caused by UiaTextRangeBase::_blockRange not being initialized, thus pointing to random memory. In most cases, we initialize it properly in RuntimeClassInitialize, however, the copying version of RuntimeClassInitialize doesn't actually copy it over, resulting in it still containing random memory.

NVDA (and other screen readers) occasionally use Clone (really just the copy initializer), resulting in this bug occurring randomly.

PR Checklist

Validation Steps Performed

Test failed before the change, but passes after the change.

@ghost ghost added Area-Accessibility Issues related to accessibility Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. labels Jul 1, 2021
@carlos-zamora carlos-zamora added zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. zStable-Service-Queued-1.12 A floating label that tracks the current Stable version for servicing purposes. labels Jul 1, 2021
@carlos-zamora carlos-zamora requested a review from DHowett July 1, 2021 23:59
@DHowett
Copy link
Member

DHowett commented Jul 2, 2021

Careful with the terminology. RuntimeClassInitialize isn't actually a "constructor" in the C++ sense specifically!

@carlos-zamora
Copy link
Member Author

Careful with the terminology. RuntimeClassInitialize isn't actually a "constructor" in the C++ sense specifically!

Fixed!

Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When Resharper comes out for VS 2022, we should all buy it together.
It has a clang-tidy integration that actually works. 😐

Copy link
Member

@miniksa miniksa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for pending comments to be complete.

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 6, 2021
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 6, 2021
@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jul 6, 2021
@ghost
Copy link

ghost commented Jul 6, 2021

Hello @DHowett!

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 79a18f0 into main Jul 6, 2021
@ghost ghost deleted the dev/cazamor/a11y/bugfix-word-boundary branch July 6, 2021 20:54
@DHowett DHowett removed zStable-Service-Queued-1.12 A floating label that tracks the current Stable version for servicing purposes. zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. labels Jul 7, 2021
DHowett pushed a commit that referenced this pull request Jul 7, 2021
## Summary of the Pull Request
#7960 was caused by `UiaTextRangeBase::_blockRange` not being initialized, thus pointing to random memory. In most cases, we initialize it properly in `RuntimeClassInitialize`, however, the copying version of `RuntimeClassInitialize` doesn't actually copy it over, resulting in it still containing random memory.

NVDA (and other screen readers) occasionally use `Clone` (really just the copy initializer), resulting in this bug occurring randomly.

## PR Checklist
* [X] Closes #7960
* [X] Tests added/passed

## Validation Steps Performed
Test failed before the change, but passes after the change.

(cherry picked from commit 79a18f0)
DHowett pushed a commit that referenced this pull request Jul 7, 2021
## Summary of the Pull Request
#7960 was caused by `UiaTextRangeBase::_blockRange` not being initialized, thus pointing to random memory. In most cases, we initialize it properly in `RuntimeClassInitialize`, however, the copying version of `RuntimeClassInitialize` doesn't actually copy it over, resulting in it still containing random memory.

NVDA (and other screen readers) occasionally use `Clone` (really just the copy initializer), resulting in this bug occurring randomly.

## PR Checklist
* [X] Closes #7960
* [X] Tests added/passed

## Validation Steps Performed
Test failed before the change, but passes after the change.

(cherry picked from commit 79a18f0)
@ghost
Copy link

ghost commented Jul 14, 2021

🎉Windows Terminal v1.9.1942.0 has been released which incorporates this pull request.:tada:

Handy links:

@ghost ghost mentioned this pull request Jul 14, 2021
@ghost
Copy link

ghost commented Jul 14, 2021

🎉Windows Terminal Preview v1.10.1933.0 has been released which incorporates this pull request.:tada:

Handy links:

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 Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UIA: incorrect word boundary
4 participants